Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
OLE DB provider, .NET, and server side updatable rowset
Message
 
 
To
11/08/2003 20:57:11
Cindy Winegarden
Duke University Medical Center
Durham, North Carolina, United States
General information
Forum:
Visual FoxPro
Category:
Visual FoxPro and .NET
Miscellaneous
Thread ID:
00819225
Message ID:
00819230
Views:
25
Hi Cindy,

I don't work with .Net but there's sample code in VFP8 help file under "Accessing Visual FoxPro Data in Visual Studio .NET" that shows how to use server side cursor.
#INCLUDE ado.h
LOCAL oRS as "adodb.recordset"
oConn = CREATEOBJECT('adodb.connection')
oRS = CREATEOBJECT('adodb.recordset')
cConnStrng = ;
   "Provider=vfpoledb;Data Source="+HOME(2)+"northwind\northwind.dbc"
oConn.Open(cConnStrng)

*!* Updatable server cursors must use the USE <table name> command to 
*!* open the table, not a SELECT statement. Server cursor is updatable,
*!* opened keyset, and lock optimistic.
oRS.Open("USE customers",oconn,1,3,1)
? 'CursorLocation:',IIF(oRS.CursorLocation=2,"adUseServer","adUseClient")
* Find CACTU.
oRS.Find("customerid='CACTU'")
? 'Current value:',oRS.Fields("contactname").Value
oRS.Fields("contactname").Value = "Patricio Simpson"
oRS.Update()
oRS.Requery()
oRS.Find("customerid='CACTU'")
? 'New value:',oRS.Fields("contactname").Value 
oRs.Close()
oRS = Null
oConn.Close()
oConn = Null
>I found this question about the new OLE DB data provider in a .NET newsgroup. Can anyone help me answer it?
>
>"It seems to that the provider doesn't support updateable rowsets at the server side. Why doesn't this provider support updateable rowsets at the server side?"
--sb--
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform