recordcount = -1

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.
 
K

KARL DEWEY

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.
 
S

Syrel

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.
 
N

NuBie via AccessMonster.com

Try this code below:


Dim rs As DAO.Recordset
Dim strSql As String
Dim i As Integer
strSql = "Select actionqueue from dpldata where actionqueue = 'Reject'"
Set rs = DBEngine(0)(0).OpenRecordset(strSql)

Do While Not rs.EOF
i = i + 1
rs.MoveNext
Loop
MsgBox i
rs.Close
Set rs = Nothing

ouch.. can someone help figure this out. it keeps returning a -1 value.
Sorry, can not help you.
[quoted text clipped - 32 lines]
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top