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!

3 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  
Blogger Alexis said...

There are a lot of files on my computer. But yesterday evening weren't files and programs too connected with access files. Luckily for me a friend called me up and by chance told me about - corrupted dbf. The software restored my damaged access files and performed it for free as I kept mind. I am glad this tool.

2:59 PM  

Post a Comment

Links to this post:

Create a Link

<< Home