CSV Import Routene

battenberg

Burning candles both ends
Local time
Today, 15:38
Joined
Sep 25, 2006
Messages
118
Hi
I now need to import a CSV file into my database on a daily basis. I have no experience of an import routene, does anybody have any pointers or do's & dont's, before I begin to try to fathom it out...

Thanks in advance.
 
re:

Hi,
you would need to use the TransferText method to import the file. After that it all depends on what you are trying to do. If you need to specify an import specification to import things correctly then import the file manually once and use the advanced button in the import wizard to create, name and save the specification...then reference it in the specification argument of the TransferText method. Furthermore, do you want this to manually execute or automatically? If automatically then there are two methods...if the application is open 24/7 then you could use a form's on timer event to check the current system time/date and execute the function based on that. If it will be closed then use a macro which executes your code...then call this macro with the macro command line switch in a batch file. You can schedule this batch file with the windows scheduler or any other scheduling software for a specific date/time.
Last but not least...keep in mind that it is almost always better to first import everything into a blank new database...then use append queries to append the data correctly formatted to existing tables. You can always drop the temp tables programmatically later on if needed.
HTH
Good luck
 
Thanks for your reply,

One thing that was puzzling me was where to aim the information in the first instance, Adding it to a new database opposed to a query in the existing makes sence.

The CSV import will be in responce to a user clicking a button and then selecting from his directory strucure.. the rest will (hopefully be automated)
 
re:

You're welcome.
Let me know if you hit a wall.
Good luck.
 

Users who are viewing this thread

Back
Top Bottom