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!
2 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
Post a Comment
<< Home