PDA

Click to See Complete Forum and Search --> : Anyone else hate recordsets???


Redspike
May 9th, 2001, 07:20 AM
I've been using ASP for about a week now. It's great, pretty straight-forward and easy with a bit of reading.

However, I've now got to a point where I realise that ASP isn't as simple as I thought. I've encountered the data access from Oracle problem.

I can connect. I can create and open a recordset. I can get data out of my recordset onto the browser. The problem I have is that I have written my code in such a way that no matter what the SQL query is, ASP will count the fields and rows and create an appropriately sized table for the data.

Except I can't count the rows.

It's a long introduction to this question but here it is:
HOW CAN I COUNT THE ROWS IN A RECORDSET???

I am using a ADODB connection with an adOpenDynamic cursor. Maybe it has something to do with that? I don't know.

Ianpbaker
May 9th, 2001, 07:27 AM
Hi Redspike

3 is the magic number. If you open the recordset cursor as 3(AdopenClient but is not listed in interdev) it should sort out your problem. recordset.open somesql,yourconncection,3.
I know it sound a bit strange but that's the only way I could get round it.

Hope it helps

Ian

monte96
May 9th, 2001, 01:05 PM
Well.. sort of..

You have to open a cursor that is located on the client (The client in this case is the IIS server).

Set the CursorLocation = adUseClient (3).

Ian.. cursor type 3 is adOpenStatic.