Importing data from Foxpro (DOS) to Access 2003

J

James Martin

Hello,

Can anyone tell me how I can import data from an old DOS Foxpro system into
Access 2003? The Foxpro system is still in use, so its data is changing and
this won't be a one-time import.

Thanks!

James
 
G

Guest

This will link your Foxpro table.
DoCmd.TransferDatabase acLink, "dBase III", strFoxProPath, _
& acTable, "wdmaster", "wdmaster"
Then construct a query to append the data from the linked table to your
Access table.
Then use a DeleteObject to remove the link to the FoxPro table
 
J

James Martin

Hi,

Thanks for the response.

I've tried implementing this but I'm getting an odd error. For strFoxProPath
I've put "c:\fox\fn125.dbf", but when I execute it I get:

--------------------

Run-time error '3044':

'c:\fox\fn125.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.

--------------------

However, there definitely IS a file c:\fox\fn125.dbf and drive C is
certainly accessible.

My actual line is:

DoCmd.TransferDatabase acLink, "dBase III", "c:\fox\fn125.dbf", acTable

Any suggestions?

Thanks!

James
 
G

Guest

I don't know if this will fix it, but you are missing the table name. It
will be the name you want the mdb table to be.

DoCmd.TransferDatabase acLink, "dBase III", "c:\fox\fn125.dbf", acTable,
"YourTableName"
 
C

Cindy Winegarden

Hi James,

What is your exact statement? A path should be like "C:\Fox\" and not
include a table name.

Set Path To C:\Fox\
Use TableName
 
J

James Martin

Hi again,

Sorry to keep bothering you with this, but I've tried the modification you
suggested and still get the same error. My code is:

DoCmd.TransferDatabase acLink, "dBase III", "c:\fox\fn125.dbf", acTable,
"tblStock"

and when I execute it I get:

--------------------

Run-time error '3044':

'c:\fox\fn125.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.

--------------------

Any other suggestions would really be appreciated.

James
 
J

James Martin

Hi Cindy,

As you've probably seen with my reply to Klatuu, my exact statement is:

DoCmd.TransferDatabase acLink, "dBase III", "c:\fox\fn125.dbf", acTable,
"tblStock"

Although I've also tried:

DoCmd.TransferDatabase acLink, "dBase III", "c:\fox\fn125.dbf", acTable

and:

DoCmd.TransferDatabase acLink, "dBase III", "c:\fox\fn125.dbf", acTable, ,
"tblStock"

They all yield a run-time error 3044 telling me that my path is invalid.

If we assume that the Foxpro file is c:\fox\fn125.dbf can you tell me
exactly what line(s) of code to use to import it into Access?

Thanks!

James
 
G

Gord

DoCmd.TransferDatabase acLink, "dBASE III", "c:\fox", _
acTable, "fn125", "fn125.DBF"
 

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