|
-
February 15th, 2000, 10:22 PM
#1
Recordcount Returns -1
I am using ADO and wanted to get the number of records in a result set. I use SQL SERVER 7.0. But everytime I issuse the command RecordCount, it always return -1 eventhough there are records in the resultset. Are there any solution for this problem?
Thanks
-
February 16th, 2000, 02:29 AM
#2
Re: Recordcount Returns -1
here is the answer from MSDn:
"Use either adOpenKeyset or adOpenStatic as the CursorType for server side cursors or use a client side cursor. Client side cursors use only adOpenStatic for CursorTypes regardless of which CursorType you select. "
-
April 5th, 2000, 08:06 AM
#3
Re: Recordcount Returns -1
Had the same problem. You must set your recordset's CursorLocation - adUseClient (I dont' remember the exact constant but I think that's what it is). One problem - it has to read the entire recordset into memory to know how many records are there so if you recordset is really big you'll run out of memory.
-
April 5th, 2000, 08:43 AM
#4
Re: Recordcount Returns -1
had the same problem just a few weeks ago. I had two recordsets open (same name). I had forgotten to close one in another form.
David Paulson
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|