recordcount = -1

  • Thread starter Thread starter Syrel
  • Start date Start date
S

Syrel

why is it i get a -1 on my record count even though my query is correct.

example query statement:

select actions from mannyActions where id = 'REJECT'

i don't know what is wrong with my query. Can somebody help me with this
one. I hope someone respond to my question as soon as possible.

thank you.
 
Where are you seeing the minus one record count as that SQL statement will
not give a count.
It will display a field named 'actions' if id = 'REJECT' and that is not a
count.
 
Here's an example code:
sSQL = "Select actionqueue from dpldata where actionqueue = 'Reject'"
Call DbConn
rs.Open sSQL, Dbase, adOpenForwardOnly, adLockOptimistic
If rs.RecordCount > 0 Then
rs.MoveFirst
i = 0
Do While Not rs.EOF
i = i + 1
rs.MoveNext
Loop
TxtDReject.Value = i
End If
Call RsClose
Call DbClose

THe rs.recordcount has a value of -1 eventhough there are lots of records in
my database. I can't figure out why it returns a -1 value.
 
Back
Top