Link to home
Start Free TrialLog in
Avatar of spiral
spiral

asked on

recordcount not working......

i am using a stored procedure to "fill" a recordset but the recordset.recordcount = 0 doesnt seems to work at all!
anyone can point me into the right direction?

sqlstr = "up_Top_ABCD '" & period8 & "' "

Set rsInvDetailStatus = New ADODB.Recordset

With rsInvDetailStatus
  .CursorLocation = adUseServer
  .Open sql66, frmMainMenu.db, adOpenKeyset, adLockBatchOptimistic, adCmdText
End With

If rsInvDetailStatus.RecordCount = 0 Then
  errmsg = MsgBox("No matching records found!", vbCritical, "No records found")
  Set rsInvDetailStatus.ActiveConnection = Nothing

else

 msgbox "have records"

end if
ASKER CERTIFIED SOLUTION
Avatar of Guy Hengel [angelIII / a3]
Guy Hengel [angelIII / a3]
Flag of Luxembourg image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of zzconsumer
zzconsumer

Before opening the Recordset, use:

rsInvDetailStatus.CursorLocation = adUseClient

This will enable you to use .RecordCount
I am sure if you were to maintain your open questions, you would find experts more receptive.  For the record:

Questions Asked 19
Last 10 Grades Given A A B A A B A B B B  
Question Grading Record 11 Answers Graded / 11 Answers Received

Anthony