FYI - if you are unable to figure out how to load access in a way that allows you to use the transferdatabase method using "dBase IV" as the database type for programatically importing a visual (?) foxpro dbf file, then ....
Here's how the transferdatabase method works using 'ODBC Database' as the database type:
1) if you don't already have it (check the version in the control panel>administrative tools>Data Sources (ODBC)) download the foxpro ODBC driver (VFPODBC.MSI) and load it so that you have the current version of the driver, which is 6.01.8629.01 dated 12/7/1999 called VFPODBC.DLL, which is current as of today (4/27/07).The link to the MSDN driver download is somewhere on this access world forum site...search threads for Robert88 and foxpro (credits to Robert88)
2) then call the method in your code, e.g.:
DoCmd.TransferDatabase acImport, "ODBC Database", "ODBC;DSN=Visual FoxPro Tables;UID=;SourceDB=F:\REVISION;SourceType=DBF;Exclusive=No;Background Fetch=Yes;Collate=Machine;Null=Yes;Deleted=Yes;DATABASE=", acTable, "J_SUMRY", "tmp_tbl_j_sumry1", False
things to look at, if it doesn't work:
Sourcedb=the directory where the dbf resides
'DSN=Visual FoxPro Tables' is the standard name the ODBC driver installation sets up...you shouldn't need to change it, but look to see if it exists in Data Sources (ODBC) if your stumped
"J_SUMRY" is the name of the dbf (sans the .dbf file extension) that you want to programmatically import
"tmp_tbl_j_sumry" is the name you're giving to the resultant imported table in access.
notes: if you're unfamiliar with how the foxpro drivers look in the administrative tools>Data Sources (ODBC) dialogue. You'll note that the same version driver is used for all the foxpro related database types (such as 'Driver para o Microsoft Visual FoxPro', 'Microsoft dBase VPF Driver', 'Microsoft VPF Driver', 'Microsoft Visual FoxPro Driver', 'Microsoft Visual FoxPro-Treiber'...also and more importantly, you should see 'Visual FoxPro Tables' and 'Visual FoxPro Database' listed as drivers that are set up and seen in the system dsn tab
Aside: My version of XP shows a place holder driver version number '1.00.02.00' in the list, which needs to be updated to the version cited above (6.01.8629.01), which is the only driver that seemed to work for me, despite making minor progress trying a specific foxpro driver I found dated 1998?
Here's how the transferdatabase method works using 'ODBC Database' as the database type:
1) if you don't already have it (check the version in the control panel>administrative tools>Data Sources (ODBC)) download the foxpro ODBC driver (VFPODBC.MSI) and load it so that you have the current version of the driver, which is 6.01.8629.01 dated 12/7/1999 called VFPODBC.DLL, which is current as of today (4/27/07).The link to the MSDN driver download is somewhere on this access world forum site...search threads for Robert88 and foxpro (credits to Robert88)
2) then call the method in your code, e.g.:
DoCmd.TransferDatabase acImport, "ODBC Database", "ODBC;DSN=Visual FoxPro Tables;UID=;SourceDB=F:\REVISION;SourceType=DBF;Exclusive=No;Background Fetch=Yes;Collate=Machine;Null=Yes;Deleted=Yes;DATABASE=", acTable, "J_SUMRY", "tmp_tbl_j_sumry1", False
things to look at, if it doesn't work:
Sourcedb=the directory where the dbf resides
'DSN=Visual FoxPro Tables' is the standard name the ODBC driver installation sets up...you shouldn't need to change it, but look to see if it exists in Data Sources (ODBC) if your stumped
"J_SUMRY" is the name of the dbf (sans the .dbf file extension) that you want to programmatically import
"tmp_tbl_j_sumry" is the name you're giving to the resultant imported table in access.
notes: if you're unfamiliar with how the foxpro drivers look in the administrative tools>Data Sources (ODBC) dialogue. You'll note that the same version driver is used for all the foxpro related database types (such as 'Driver para o Microsoft Visual FoxPro', 'Microsoft dBase VPF Driver', 'Microsoft VPF Driver', 'Microsoft Visual FoxPro Driver', 'Microsoft Visual FoxPro-Treiber'...also and more importantly, you should see 'Visual FoxPro Tables' and 'Visual FoxPro Database' listed as drivers that are set up and seen in the system dsn tab
Aside: My version of XP shows a place holder driver version number '1.00.02.00' in the list, which needs to be updated to the version cited above (6.01.8629.01), which is the only driver that seemed to work for me, despite making minor progress trying a specific foxpro driver I found dated 1998?