How to import tables from a Fox Pro Database Programmatically ?

M

Mota

Hi;
In some Databases,such as fox pro (under DOS systems),tables are saved
independently from the main Database file.So,although i can import a table
that is saved on my drive E (named E:\m1.dbf) using dBase IV driver and thru
'File>Get External Data' menu,i cant do this through code and the error
"E:\m1.DBF is not a valid path" occures for the [Database Name] argument of
the TransferDatabase method of DoCmd object. i.e I use:
DoCmd.TransferDatabase acImport, "dBase IV", "E:\M1.DBF", acTable, "M1.DBF",
"M1", False
and the mentioned Error occures (RunTime Error 3010).So,what would be the
DatabaseName argument in these cases?any help or comment would be
appreciated.
I work in Access 2000 .
Thank you in advance.
 
G

Guest

Hi Mota,
This is an example of how I import dbf files into Access:

DoCmd.TransferDatabase acImport, "dBase 5.0", "C:\IMPORT\", acTable,
"USAIMP.DBF", "IMPMARV"

Your problem is that you're putting the file name with the path, the first
name is the path only:
DoCmd.TransferDatabase acImport, "dBase IV", "E:\M1.DBF", acTable, "M1.DBF",
"M1", False

So, to re-write yours, try:
DoCmd.TransferDatabase acImport, "dBase IV", "E:\", acTable, "M1.DBF",





Mota said:
Hi;
In some Databases,such as fox pro (under DOS systems),tables are saved
independently from the main Database file.So,although i can import a table
that is saved on my drive E (named E:\m1.dbf) using dBase IV driver and thru
'File>Get External Data' menu,i cant do this through code and the error
"E:\m1.DBF is not a valid path" occures for the [Database Name] argument of
the TransferDatabase method of DoCmd object. i.e I use:
DoCmd.TransferDatabase acImport, "dBase IV", "E:\M1.DBF", acTable, "M1.DBF",
"M1", False
and the mentioned Error occures (RunTime Error 3010).So,what would be the
DatabaseName argument in these cases?any help or comment would be
appreciated.
I work in Access 2000 .
Thank you in advance.
 
M

Mota

Works fine.Thank you.

Belinda said:
Hi Mota,
This is an example of how I import dbf files into Access:

DoCmd.TransferDatabase acImport, "dBase 5.0", "C:\IMPORT\", acTable,
"USAIMP.DBF", "IMPMARV"

Your problem is that you're putting the file name with the path, the first
name is the path only:
DoCmd.TransferDatabase acImport, "dBase IV", "E:\M1.DBF", acTable, "M1.DBF",
"M1", False

So, to re-write yours, try:
DoCmd.TransferDatabase acImport, "dBase IV", "E:\", acTable, "M1.DBF",





Mota said:
Hi;
In some Databases,such as fox pro (under DOS systems),tables are saved
independently from the main Database file.So,although i can import a table
that is saved on my drive E (named E:\m1.dbf) using dBase IV driver and thru
'File>Get External Data' menu,i cant do this through code and the error
"E:\m1.DBF is not a valid path" occures for the [Database Name] argument of
the TransferDatabase method of DoCmd object. i.e I use:
DoCmd.TransferDatabase acImport, "dBase IV", "E:\M1.DBF", acTable, "M1.DBF",
"M1", False
and the mentioned Error occures (RunTime Error 3010).So,what would be the
DatabaseName argument in these cases?any help or comment would be
appreciated.
I work in Access 2000 .
Thank you in advance.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top