Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
ADO and VFP
Message
From
09/03/1999 12:26:35
Bob Lucas
The WordWare Agency
Alberta, Canada
 
 
To
09/03/1999 11:45:54
General information
Forum:
Visual FoxPro
Category:
Client/server
Title:
Miscellaneous
Thread ID:
00195141
Message ID:
00195617
Views:
20
>But my problem is not that I dont know a name of the property but an order of statements. Every time I am trying to set cursor type it says cannot because either something is open or something is closed.
>Mark

Here is a bit of code that will create an updateable cursor. It uses OLE DB rather than ODBC but the concept is the same. (SQL Server 7.0 Only)
This will run on an ASP Page

Set cn = Server.CreateObject("ADODB.Connection")

' Specify the OLE DB provider.
cn.Provider = "sqloledb"

' Specify connection string on Open method.
' To run the sample, edit this line to reflect your server's name.
ConnStr = "Server=Your_SQL_Server_Name;Database=Pubs;UID=sa;PWD=;"
cn.Open ConnStr


'Create a recordset
Set rs = Server.CreateObject("ADODB.Recordset")

'Create a query string that retrieves the information
querystr = "SELECT * FROM authors"

'Set all the properties for the recordset and then open it.
rs.ActiveConnection = cn
rs.CursorType = adOpenKeyset && 1
rs.LockType = adLockOptimistic && 3
rs.Source = querystr
rs.Open
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform