Have come across an annoying feature of MI when opening text files, or perhaps it is a bug?
When you open a text file, MapInfo creates a tab file for it as it should. Unfortunately, the field types assigned to the various fields seem a bit random. You can fix this by editing the tab file and specifying the field types in the table definition. So far so good.
But if you replace the text file, MapInfo rewrites the tab file again, and gets the field wrong again. Am not sure of the trigger, but thought perhaps it is the time stamps on the tab and text files? I assume that it does this so as not to corrupt index files.
Not sure what to do about this (I don't have to have indices), as I want to replace this text file frequently during the day - and not have to edit the tab files each time. I could write a routine that copies the tab file before it replaces the text file, but really....
Went down the path of setting up a linked DBMS table using the text file drivers, but the field guesses were just as bad, and I could not see anywhere to specify the field type either. This would actually be the preferred path as I could have indices on the table.
One answer seems to be to force it to define a column as a type such as a integer or a date by formatting the column in the SQL statement (eg. CINT()). The syntax will thus be based on the ODBC driver chosen, Which means that I can't use the NumberToDate function, and need to do some parsing...., and include some IFF and IsNumeric statements to weed out nulls that cause errors when thrown at conversion functions....
Am willing to go down that path, but can't help but think that perhaps i am missing something?
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: 8899
