Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

changing Import Spec depending on the files delimeter

Status
Not open for further replies.

scottian

Programmer
Jul 3, 2003
955
GB
Ive set up a nice automated way of importing files into a database on a daily basis. Ive managed to set this up so that I can leave the job to a noob to carry out. However one of the suppliers of the files decided to change the field seperator in the file so that the import fell over.
Is there a way of having the module check the file contents first to see which delimiter is in use and then decide which import spec should be used for the import.

Cant think of anything...
 

You should open the file with the old classic way (Open statement), retrieve the first records' delimiter character at the expected position and choose accordingly.
You could mess with the delimiter defined in MSysIMEXSpecs tanble (system table, change that option on Tools->Options View tab, Show frame) thru VBA, or create a different Import Specs for different delimiters.
 
you could externally access the access database, and insert the records without having to startup access at all.

this can be all done in a script which can be scheduled as a job on a server somewhere, would eliminate the need for human interaction altogether...

--------------------
Procrastinate Now!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top