Hi thanks for the replies.

It seems that yes, when a text file is replaced by another, the tab file is overwritten by mapinfo when it is opened again. This means that if you edit the tab file to force MI to define certain fields as a particular type, these changes will be lost without warning when you replace that text file with an updated copy.

This is probably a reasonable protective feature to avoid corruption of indices, but very microsoftish. Evidently the same thing happens with dbf files, but at least there you have the ability to define fields to some degree.

Martin correctly pointed out that spaces and perhaps leading decimal points will make the drivers assume that the field is a character field. This did explain why sometimes the numeric fields were coming out as character by default.

Dates represent a problem, as they don't seem to register as dates no matter what format you use. The number format that Mapinfo uses is recognised as a number (fair enough), but when presented with a standard date format the drivers thinks it is a character field. A bit frustrating as if the data is Mapinfo's standard numeric date format, and you edit the field definition in the tab file, it works as a date quite well.

So perhaps the best option is to go down the SQl path and force the conversion of each field to the desired type using convresion functions. Should be a hoot as you have to check for errors on the fly, eg to make a date function work where there may be nulls, you have to at least use something like: IIF(IsNull(field),Null,CDate(field)) As AnotherFieldName. Perhaps I will cheat and set up the query in Access and copy the SQL.....

R

--

Robert Crossley
Agtrix P/L
9 Short St
New Brighton 2483
Far Southern Queensland
AUSTRALIA

153.549004 E 28.517344 S

P: 02 6680 1309
F: New Connection
M: 0419 718 642
E: [EMAIL PROTECTED]
W: www.agtrix.com
W: www.wotzhere.com

---------------------------------------------------------------------
List hosting provided by Directions Magazine | www.directionsmag.com |
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
Message number: 8921



Reply via email to