Importing FoxPro 2.6 DBF Into Access 2007

  • Thread starter Thread starter Redelman
  • Start date Start date
R

Redelman

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
answer.

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
Tables;SourceType=DBF;SourceDB=z:\temp\sampleus.dbf;Collate=Machine",
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?

Thanks,
Roger
 
Problem solved.....


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