Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

.MovePrevious Not working

Status
Not open for further replies.

riarc

Programmer
Dec 6, 2001
44
US
How do you .MovePrevious? I have a recordset that was opened with a keyset cursor type. Do I have to asign the adMovePrevious constant to the cursor? .MoveNext works fine. What am I doing wrong?

Public Function CreateRsDetails()
DBConnect True

Dim cmDetail As ADODB.Command
Dim prmName As ADODB.Parameter
Dim strName As String
Dim blnSupports As Boolean


strName = Trim(frmCobra.cboName.Text)

Set rstDgDetail = New ADODB.Recordset

With rstDgDetailadOpenKeyset

.CursorType = End With

blnSupports = rstDgDetail.Supports(adMovePrevious)

If rstDgDetail.Supports(adMovePrevious) = True Then
MsgBox "Yip"
Else
MsgBox "nope"

End If


Set cmDetail = New ADODB.Command
With cmDetail
.CommandType = adCmdStoredProc
.CommandText = "rtv_cobra_details"
End With

'Create Parameter to enter into proc
Set prmName = cmDetail.CreateParameter("Name", adVarChar, , 50, strName)
cmDetail.Parameters.Append prmName

'Exec stored Procedure and get record set
Set cmDetail.ActiveConnection = cnCobraDB
Set rstDgDetail = cmDetail.Execute
 
Dear riarc,

What DB are you connecting to? Does it provide moveprevious?

As a ado.recordset cannot open a keyset-cursor on a db that does not support moveprevious.

regards astrid
 
I was able to figure it out.. I had to declare the keyset cursor on the db connect. Thanks anyway
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top