L
lucycard
I need your help with this!
I have a Visual FoxPro version 9 database (DBC container) that contains
several DBF's that I'm trying to write VBA code to import them into Access.
The application is still in Access 97. I found that the
DoCmd.TransferDatabase command is looking for FoxPro 2.6 version files.
I have been able to create a ODBC to the VFP database container and manually
select and import the files.
I must be missing a step because I'm getting an error "Operation is not
supported for this type of object DAO.Recordset":
Dim mycon As ADODB.Connection
Dim myrst As ADODB.Recordset
Dim strFolder, strTabName as string
Set mycon = CreateObject("ADODB.Connection")
Set myrst = New ADODB.Recordset
strfolder = "C:\myfolder\mydb.dbc"
strTabNmae = "myfile.dbf"
mycon = "Provider=vfpoledb;" & _
"Data Source=" & strfolder & ";" & _
"Mode=ReadWrite;" & _
"Collating Sequence=MACHINE:" & _
"Password="
mycon.Open
myrst.Open strTabName, mycon, adOpenDynamic, adLockReadOnly
' In both cases I get the error message:
'Try number one
' DoCmd.TransferDatabase acImport, myrst, strfolder, acTable,
strTabName, strTabName, False
'Try number two
DoCmd.TransferDatabase acImport, , strFolder, acTable,
strTabName, strTabName, False
This is the only code in the app referring to ADODB.
How do I correct this to automate the file import process?
Your help is appreciated!
I have a Visual FoxPro version 9 database (DBC container) that contains
several DBF's that I'm trying to write VBA code to import them into Access.
The application is still in Access 97. I found that the
DoCmd.TransferDatabase command is looking for FoxPro 2.6 version files.
I have been able to create a ODBC to the VFP database container and manually
select and import the files.
I must be missing a step because I'm getting an error "Operation is not
supported for this type of object DAO.Recordset":
Dim mycon As ADODB.Connection
Dim myrst As ADODB.Recordset
Dim strFolder, strTabName as string
Set mycon = CreateObject("ADODB.Connection")
Set myrst = New ADODB.Recordset
strfolder = "C:\myfolder\mydb.dbc"
strTabNmae = "myfile.dbf"
mycon = "Provider=vfpoledb;" & _
"Data Source=" & strfolder & ";" & _
"Mode=ReadWrite;" & _
"Collating Sequence=MACHINE:" & _
"Password="
mycon.Open
myrst.Open strTabName, mycon, adOpenDynamic, adLockReadOnly
' In both cases I get the error message:
'Try number one
' DoCmd.TransferDatabase acImport, myrst, strfolder, acTable,
strTabName, strTabName, False
'Try number two
DoCmd.TransferDatabase acImport, , strFolder, acTable,
strTabName, strTabName, False
This is the only code in the app referring to ADODB.
How do I correct this to automate the file import process?
Your help is appreciated!