Importing FoxPro 2.6 DBF Into Access 2007



All - I am looking for a little help. As part of a larger application, I
need to IMPORT (not link) a FoxPro 2.6 DBF into a Access DB.

I am doing so with a Access MODULE and in the module, using the
docmd.TransferDatabase method.

I have looked for days at different samples and I cannot seem to find the

My OS is Win7, 64-Bit. Access 2007 is installed.

This application is intended to be distributed with NO ASSURANCE the user
will have the FoxPro OLE driver installed. Knowing that the ODBC driver will
most likely be installed as part of MDAC, it is pretty safe to use the ODBC
driver that is already installed - Visual FoxPro Tables.

I do not want the user to use the ODBC Admin tool to configure the setup for
this default driver - It all needs to be done in code.

The code I am trying is:
DoCmd.TransferDatabase acImport, "ODBC Database", "ODBC;DSN=Visual FoxPro
acTable, "sampleus.dbf", "ccimported"

Following the structure of the command, I am trying to:
-Perform an Import
-Using the ODBC Database driver and the default DSN for this.
-The table is a "free table directory" type (DBF)
-The path to the file is z:\temp
-The filename is sampleus.dbf
-I want to call name the imported table ccimported when it is imported.

I have tried different combinations of the above - specifically setting
SourceDB=z:\temp\ with no luck.

Has anyone done this or can you help with the Transferdatabase method?



Problem solved.....

DoCmd.TransferDatabase acImport, "ODBC Database", "ODBC;DSN=Visual FoxPro
Tables;SourceType=DBF;SourceDB=z:\temp\;Collate=Machine", acTable,
"sampleus", "Importzzz"

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