Importing a FoxPro table using VBA

MarkGallie

Registered User.
Local time
Today, 14:55
Joined
Apr 17, 2013
Messages
13
I'm trying to import a few tables from a FoxPro database into an Access Database using VBA code. I know I have done it before and I remember struggling with the format last time. Can anyone see where I'm going wrong?

DoCmd.TransferDatabase acImport, "ODBC Database", "ODBC;DSN=Hiremate;SourceDB=\\data-ww\apps\hmfox32\data\hiremate.dbc;SourceType=DBC;Exclusive=No;BackgroundFetch=Yes;Collate=Machine;Null=Yes;Deleted=Yes", acTable, "hires"
 
The error I'm receiving is:

Run-time error '3011': The Microsoft Access database engine could not find the object ". Make sure the object exists and that you spell its name and path name correctly.

Which part of the statement is this referring to? The table names and paths are spelt correctly so I assume this is an issue with the format of the statement.
 
Try linking the table first so you can take a look at the connection string (MSysObjects-unhide if necessary). I haven't linked a FoxPro table in years and so have no idea if your connection string is correct.
 

Users who are viewing this thread

Back
Top Bottom