Each procedure pulls all of the tables for one DBC... Here is an example of one procedure...
ODBC Driver Visual FoxPro Driver V. 6.01.8629.01
Public Sub getApplicantData()
' Declare Variables
Dim strCon As String
Dim strTable As String
Dim rsTemp As ADODB.Recordset
' Set Variables
Set rsTemp = New ADODB.Recordset
' Open Data
With rsTemp
.ActiveConnection = CurrentProject.Connection
.CursorType = adOpenStatic
.LockType = adLockOptimistic
.Open "SELECT * FROM tblNames WHERE (tblNames.DBC='applicnt')", Options:=adCmdText
End With
' Import Data
Do While Not rsTemp.EOF
strTable = rsTemp!Table
strCon = _
"ODBC;DSN=Visual FoxPro Tables;UID=;SourceDB=" & strPath _
& "applicnt.dbc;SourceType=DBC;Exclusive=No;" _
& "BackgroundFetch=Yes;Collate=Machine;Null=Yes;Deleted=No;;" _
& "TABLE=" & strTable
DoCmd.TransferDatabase _
acImport, _
"ODBC Databases", _
strCon, _
acTable, _
strTable, _
strTable, _
False
rsTemp.MoveNext
Loop
' Close & Clear
rsTemp.Close
Set rsTemp = Nothing
End Sub
The list of tables is provided for looping purposes...
>Can you post the code? And also which version of the VFP ODBC driver are you using?
>
>
>>I do not want the users of the MS ACCESS app to be able to modify the data that resides in the VFP database. I only provide Query, Report, & Macro abilities.
>>
>>>Why don't you just link them instead?
>>>
Dim db As Database
>>> Dim td As TableDef
>>>
>>> Set db = CurrentDb
>>> Set td = db.CreateTableDef("Test")
>>>
>>> td.SourceTableName = "category"
>>> td.Connect = "ODBC;dsn=testdbc"
>>>
>>> db.TableDefs.Append td
>>>That way you don't need to worry about them being in synch. HTH
>>>
>>>>I have a Visual FoxPro Application that contains 4 DBCs and some Free Tables. As an add on tool I provide an Access Application that gives a static(but synchronized) version of the data. After many days of hair-pulling, I resorted to ADO Programming to delete the local Access Tables, Create piece-by-piece the tables then fill record by record the data.
>>>>
>>>>I would like to know if there is a fix for the following problem:
>>>>
>>>>I know the DoCmd.TransferDatabase will save me overhead and code updating time later as revision to table structures occur. My problem, however, is that I can only connect to one DBC. I am successfully able to connect to any one DBC and import all of its tables programatically. When I try to connect to the next DBC, however, the application halts with the error :
>>>>
>>>>Run-Time Error '3184'
>>>>Could not execute query; could not find linked table.
>>>>[Microsoft][ODBC Visual FoxPro Driver]Ca (#562)
>>>>
>>>>I know the code is accurate because I can run each DBC procedure individually, but upon moving to the nect DBC it fails.
>>>>
>>>>Any response would be helpful, thank you.