Hi Jim,
> I currently have Visual Foxpro driver version 6.01.8629.01 installed. I
> created a DSN and used it to link to one of the Foxpro tables to an Access
> 97 DB. This particular table only has about 500 records. It takes the
> linked table over 14 minutes to display and then Access locks up.
I've seen reports of problems like this but haven't pursued it to
see if there's a solution.
> I've tried to install the newer driver from MS's website, but when I
> launch the install program, a dialog box flashes too fast for me to read
> and the program quits.
Newer driver? Do you perhaps mean the OLE DB data provider? That's
not a "newer" ODBC driver; OLE DB is a whole new technology. In any case,
the OLE DB data provider is downloadable from the same URL I posted before.
> can you give me an example of an ADO connect string that will allow me to
> read and write to these tables?
Public Sub Main()
'-- First create a table
Dim conn1 As ADODB.Connection
Set conn1 = New ADODB.Connection
conn1.Open _
"Provider=VfpOleDB.1;" & _
"Data Source=C:\;"
Set cmd1 = New ADODB.Command
cmd1.CommandType = adCmdText
cmd1.ActiveConnection = conn1
cmd1.CommandText = _
"Create Table Test " & _
"(Field1 N(10, 4), Field2 C(10))"
cmd1.Execute
cmd1.CommandText = _
"Insert Into Test Values " & _
"(100, 'HelloWorld')"
cmd1.Execute
conn1.Close
Set conn1 = Nothing
'-- Now make some changes
Set conn1 = New ADODB.Connection
conn1.Open _
"Provider=VfpOleDB.1;" & _
"Data Source=C:\;"
Set cmd1 = New ADODB.Command
cmd1.CommandType = adCmdText
Set cmd1.ActiveConnection = conn1
cmd1.CommandText = _
"Update Test " & _
"Set Field2 = 'Goodbye' " & _
"Where Field1 = 100"
cmd1.Execute
conn1.Close
Set conn1 = Nothing
End Sub
James Houston - 20 Apr 2005 16:11 GMT
Thanks again for your help. Another project has come up that I have to work
on first, but I'll give your example a try in a couple of days.
Thanks again
Best
Jim
> Hi Jim,
>
[quoted text clipped - 59 lines]
>
> End Sub
James Houston - 30 Apr 2005 20:44 GMT
Cindy
I finally got VB talking to Foxpro, but I'm still running into trouble when
I try to update a recordset. The following code:
With rs
.ActiveConnection = conn1
.CursorLocation = adUseClient
.CursorType = adOpenKeyset
.Open "c:\cpsw\cps.dbf", , adOpenKeyset, adLockOptimistic
End With
With rs
.AddNew
!invoice = "11111"
.Update
End With
returns the error message "Insufficient base table information for updating
or refreshing". Any idea what I'm doing wrong? Or does the Foxpro OLE DB
provider not support updateable recordsets? Do I have to build an INSERT
query to add data to the Foxpro tables?
Thanks for your help.
Best,
Jim
> Hi Jim,
>
[quoted text clipped - 59 lines]
>
> End Sub