AccessBlog.net

News, links, downloads, tips and tricks on Microsoft Access and related

About Me Search
Alex
Name:Alex Dybenko

Location:Moscow, Russia

Tuesday, August 01, 2006

Correct syntax to import DBF file

It is not so easy to find correct syntax to import DBF files. According to Access help one can write:
DoCmd.TransferDatabase acImport, "dBase 5.0", "C:\MyDir\MyFile.dbf"
But it will file with error 3044 “'C:\MyDir\MyFile.dbf' is not a valid path.  Make sure that the path name is spelled correctly and that you are connected to the server on which the file resides.”
Correct syntax is:
DoCmd.TransferDatabase acImport, "dBase 5.0", "C:\MyDir", acTable, "MyFile", "MyFile"
Please note that there is no need to add .dbf extension in source argument!

2 Comments:

Anonymous Anonymous said...

Alex, thanks!! The CSV to MDB conversion I'm attemping with VisualBasic produces error after error.

Runtime Error 3044 is gone, (it's the 10th error I found), now I have error 3125 instead... time to Google for it now.

Thanks,
Andrés
(Argentina)

9:10 AM  
Anonymous Anonymous said...

You just saved me a ton of time! Thanks for posting that!

NYC

10:00 PM  

Post a Comment

<< Home