I have a foxpro database that we are trying to write to using MS Access 2007 via a VFP ODBC driver (The driver is version 6.x)
Are there limitations in doing this? No matter what we try we are not able to write to the foxpro data tables.
We are using ODBC It is the MS VFP driver The Foxpro and access DBs are on the same system The ODBC is setup for Free Table Directory Permissions on the foxpro directory and files has been checked.
We are not getting any specific error but we do not have the option to create a new entry in Access on the FP table and we cannot run a query that inserts data from Access to the FP tables.
Any help would be great
Here's the code:
Dim dbs As DAO.Database
Dim rsSQL As DAO.Recordset
Dim strSQL As String
Dim strSQL2 As String
Dim strConnString As String
Set oConn = CreateObject("ADODB.Connection")
strConnString = "Data Source= C:\Program Files\Best Software\Abra Suite\Programs\Data\hrtables.dbf;User ID = ;Password = ; Provider=VFPOLEDB"
oConn.Open strConnString
Set dbs = CurrentDb
strSQL = "Select * from qryAppendClient"
Set rsSQL = dbs.OpenRecordset(strSQL, dbOpenSnapshot)
Do While Not rsSQL.EOF
strSQL2 = "Insert into hrtables (c1, c2, c3, c4, Code, Company, Desc, GLComp, n1, n2, n3, Rule, "
strSQL2 = strSQL2 & "Table, tccomp, ud1, ud2, ud3) values (""" & rsSQL!c1 & """, """ & rsSQL!c2 & """, """ & rsSQL!c3
strSQL2 = strSQL2 & """, """ & rsSQL!c3 & """, """ & rsSQL!Code & """, """ & rsSQL!Company & """, """ & rsSQL!Desc & """, """
strSQL2 = strSQL2 & rsSQL!GLComp & """, " & rsSQL!n1 & ", " & rsSQL!n2 & ", " & rsSQL!n3 & ", """
strSQL2 = strSQL2 & rsSQL!Rule & """, """ & rsSQL!Table & """, """ & rsSQL!tccomp & """, """ & rsSQL!ud1 & """, """
strSQL2 = strSQL2 & rsSQL!ud2 & """, """ & rsSQL!ud3 & """)"
oConn.Execute strSQL2
Loop
oConn.Close
rsSQL.Close