how to get the number of records returned by a query? I used rec.rows.count as below but didn't work, rec.Fields.count for number of coloumns works fine.
Set obj = CreateObject("ADODB.Connection")
SQLquery = "select login_id "&_
"from tc_admin.mbrshp_info "&_
"where login_id like 'testuser%' "&_
"order by 1"
Set rec = obj.Execute(SQLquery)
numofRows= rec.rows.count ' this is not supported
U can add a variable and keep on incrementing inside a while loop until beginning of file(BOF) or End of File(EOF)..that vatriable will give u the number of records ..I guess this Logic will work in ur case
rec.recordcount always returns -1
there is a solution for SQL Server using LAST in my query and get the last record
but in SQL Plus I don't know how to get the last record , so I have to do what Thilak suggested looping over all the records to get the last record number
Thanx All , once I find an ORACLE solution I will post it.
If you use
DBrec.Open "Select * from tabl21",DBconn, adOpenDynamic, adLockOptimistic
then rec.recordcount may give you the properties. Its actually dependent on the database product that is being used.