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!
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:
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)
You just saved me a ton of time! Thanks for posting that!
NYC
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.
Post a Comment
<< Home