CursorType Property Example
Option Explicit
Dim er As rdoError
Dim cn As New rdoConnection
Dim qy As New rdoQuery
Dim rs As rdoResultset
Dim col As rdoColumn
Private Sub Form_Load()
cn.CursorDriver = rdUseClientBatch
cn.Connect = "uid=;pwd=;server=sequel;" _
& "driver={SQL Server};database=pubs;dsn='';"
cn.EstablishConnection
'
' Setup the query
'
With qy
.Name = "ShowAuthor"
.SQL = "Select * from Authors " _
& "where Au_LName = ? "
.LockType = rdConcurReadOnly
.CursorType = rdOpenForwardOnly
.RowsetSize = 1
Set .ActiveConnection = cn
End With
'
' Execute the Query by Name
' Pass in a parameter to the query
'
cn.ShowAuthor "White"
'
' Process the resulting rows
'
If cn.LastQueryResults is Nothing then
Else
Set rs = cn.LastQueryResult
For Each col In rs.rdoColumns
Print col.Name,
Next
Print String(80, "-")
Do Until rs.EOF
For Each col In rs.rdoColumns
Print col,
Next
Print
rs.MoveNext
Loop
End if
End Sub