






Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!







' You can use a select statement to 'create' a snapshot forward only,' read only cursor. (A "firehose" cursor)dim rs
'as ADODB.Recordset
dim mySQL
'as string
mySQL = "Select * from authors"Set rs = CN.Execute mySQL'... Use cursorrs.Closeset rs = nothing
Dim mySQL as StringDim rs As New ADODB.Recordset'Assume CN is an ADODB.Connection Object and is OpenmySQL = "Select * From Authors"'Notice use of SET verbSet rs.ActiveConnection = CNrs.CursorLocation = adUseClientrs.CursorType = adOpenDynamicrs.LockType = adLockOptimisticrs.Source = mySQLrs.Open
.MoveFirst, .MoveLast, .MovePrevious, .MoveNext(moves cursor in rows, error if
or
or if
.RecordCount
.Move
n (
moves number of rows specified by, see note
above)
-^
.AddNew (adds a new row to recordset, applies defaults ifany, needs to be followed by
.Update
.Update (commits changes to .Recordset)
-^
.UpdateBatch (use in addition to update with batchlocking)
the previous EOF/BOF test) 0: No records1…n (only valid for static type (read only) recordsets)
Set rs = Server.CreateObject("ADODB.Recordset")' Not no SET, creates a unique connectionrs.ActiveConnection = cDSN
'DSNless string
rs
.CursorLocation = adUseClient rs
.CursorType = adOpenStatic rs
.LockType = adLockBatchOptimistic rs
.Source = mySQL rs
.Open 'If you only need one recordset, period, use this.