Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Foxpro OLE DB Driver - Does it support updating???
Message
From
08/02/2002 12:01:22
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Visual FoxPro and .NET
Title:
Foxpro OLE DB Driver - Does it support updating???
Miscellaneous
Thread ID:
00617493
Message ID:
00617493
Views:
77
Does anyone know if the foxpro OLE DB driver supports updating Foxpro databases?

The following code uses ADO to connect and attempt to edit a simple foxpro table.
If I use the ODBC connection string, it works. If I use the OLE DB connection string if causes an error something like

"object or provider is not capable of performing the required operation"

I have also being playing with visual studio .net, and get a similar problem. I can connect and retrieve data happily using the oledbdataadapter object, but updating, inserting or deleting foxpro tables fails every time.

the code listing (please change the file paths and table names if you want to try it)


&&&here is the ole db connection string
constr='Provider=VFPOLEDB.1;Data Source=C:\FXCLIENT\CSDATA\CSDATA.DBC;Mode=Share Deny None;Extended Properties="";User ID="";Password="";Mask Password=False;Cache Authentication=False;Encrypt Password=False;Collating Sequence=MACHINE'

&&&here is the odbc connection string
constr='DSN=testpms;UID=;PWD=;SourceDB=C:\fxclient\CSdata\csdata.dbc;SourceType=DBC;Exclusive=No;BackgroundFetch=Yes;Collate=Machine;'


&&here is the odbc connection string



con=Createobject("adodb.connection")

con.connectionstring=constr
con.Open
Sqlstr="select client,surname from clients where client='A0001'"
rs=Createobject("adodb.recordset")
rs.cursortype=2
rs.locktype=3
rs.Open(Sqlstr,con)

If Not rs.Eof
Messagebox("record found")
rs.Fields("surname").Value="test update"
rs.Update
Else
Messagebox("record not found")
Endif
rs.close
con.Close
RELEASE rs
RELEASE con
Next
Reply
Map
View

Click here to load this message in the networking platform