Specify file path in import text ACCESS 2003

I have an import that I am creating in my development version of the database.  the source for the text file is in my development environemnt, but the path will change i production.  I am a little perplexed in how to I tell the code to pick up the path in the transfer text statement?  The saved import seems to only use the original location and specification has to be added manually, I want to use the specification, but pass in the path string so I can change the variable when it goes online.

Who is Participating?
Jeffrey CoachmanConnect With a Mentor MIS LiasonCommented:

Lets be clear, are you talking about an "Import Specification" (saved "during" the import wizards steps, (Click the "Advanced" button))

...Or are you referring to a "Saved Import" (created at the end of the wizard: ("Save export steps?"))

If you are using a "Saved Import", I don't think you can set the path/filename if you run this in code.

If you use an "Import Specification", you can specify the source, ...like so:
DoCmd.TransferText acImportDelim, "YourImportSpec", "YourTableName", "C:\YourFolder\YourFile.txt"
(I know that you specify the file to import in the wizard,  but this info is not saved in the in the Import Spec (AFAIK))

The distinction between the two ("Import Specifications", versus "Saved Imports" was never easy to determine...

But for automation where you need to specify the import file name  and the table name in code, I would use an Import Spec

Scott McDaniel (Microsoft Access MVP - EE MVE )Infotrakker SoftwareCommented:
How are you doing the import now? Can you show the code you're using?
ssmith94015Author Commented:
Thank you, it wasd the path placement and your are right, the difference between Import Specificiations and Saved Imports had been a bit perplxed, but I got it now.  

Jeffrey CoachmanMIS LiasonCommented:
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.