Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Foxpro OLE DB Driver - Does it support updating???
Message
De
08/02/2002 12:01:22
 
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
Visual FoxPro et .NET
Titre:
Foxpro OLE DB Driver - Does it support updating???
Divers
Thread ID:
00617493
Message ID:
00617493
Vues:
79
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
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform