Try TransferText, e.g.:
DoCmd.TransferText acImportDelim, "MySpec", "MyTable", "C:\MyFile.txt"
--
Allen Browne - Microsoft MVP. Perth, Western Australia.
Tips for Access users -
http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.
"Frank M" <(E-Mail Removed)> wrote in message
news:11FB3CCA-00B9-4771-9219-(E-Mail Removed)...
>I have a monthly update to make on an Access database (2000 format) that
> involves the execution of several imports queries.
> I have all the actions to be done in a table in Access. Now I want to
> automate the whole job through a program. As far as I can see running the
> queries can be done through the DoCmd object, the RunSQL method (or
> perhaps
> better through ADO and ADOX to get the query contents).
> However, I can't see how I would perform the imports using the Import
> specifications that I have saved in the database.
> Besides giving the Import Spec name I would also have to give the name of
> the table to be imported too. So my question is:
>
> How can I start an import with a given Import Spec (by name) to a named
> table?
>
> I have found an Application.DoCmd object with a RunCommand method that I
> can
> use with the parameter acCmdImport. But my guess is that this will just
> open
> the Import dialog window from which I would have to proceed manually. I
> don't
> see anywhere to specificy the import spec name or input table name in the
> call of the method.
>
> Hope someone can help.
>
>
> Best regards,
>
> Frank M.