|
-
Jun 28th, 2001, 02:38 PM
#1
Thread Starter
Member
Record Count question (yes it's a Keyset Cursor)
I'm just doing a basic little test to print out records and a record count, and even though I've set the cursor to adOpenKeyset (both with the CursorType=adOpenKeyset and w/i the objRS.Open properties) and it's still giving me the blasted -1 !!
I've also set the cursor location to client, and done some manipulations there as well.
Here's the code, any thoughts? Much appreciated!
<%
Dim objConn
Set objConn = CreateObject("ADODB.Connection")
objConn.ConnectionString="DSN=A_Test"
objConn.Open
Dim objRS, strSQL
Set objRS=Server.CreateObject("ADODB.Recordset")
strSQL="SELECT * FROM Products"
objRS.Open strSQL, objConn, adOpenKeyset
Response.Write "<B> A Listing of our Products </B><BR>"
Response.Write "Record Count: " & objRS.RecordCount & "<BR>"
Do While Not objRS.EOF
Response.Write objRS("Brand") & " " & objRS("Model") & "<BR>"
objRS.MoveNext
Loop
objRS.Close
Set objRS = Nothing
objConn.Close
Set objConn = Nothing
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
|