can't get recordcount property to work!!

N

Navin Kulshreshtha

Hi folks, I'm opening a recordset with a SQL statement and then trying
to use the .RecordCount property to count the number of rows in the
recordset. For some reason, it is always returning -1. Here's the code
(I have left out the details for the connection string):

-------------------
strSQL = "SELECT * from orders"
strConnect = [details removed]
Set osRecordSet = Server.CreateObject("ADODB.Recordset")
osRecordset.Open strSQL, strConnect

Response.Write osRecordSet.Recordcount & "<br>"
-------------------

This last line always returns -1. Please help!!

Thanks,
Navin
 
N

Navid

Hi,

Just Change osRecordset.Open strSQL, strConnect to
osRecordset.Open strSQL, strConnect,1,3
Thats All!

-Nav!d
 

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

Members online

Forum statistics

Threads
473,770
Messages
2,569,586
Members
45,087
Latest member
JeremyMedl

Latest Threads

Top