cannot count number of records.

Results 1 to 2 of 2

Thread: cannot count number of records.

  1. #1
    Anandhi.P Guest

    Default cannot count number of records.

    i need to count the total number of records thro a recordset.<BR>its gives me -1 when i use recordset.recordcount property.<BR>why is it so.

  2. #2 Guest

    Default RE: cannot count number of records.

    set Conn=Server.CreateObject("ADODB.Connection")<BR>Co nn.Open YourConnectionString<BR>Set rs=Server.CreateObject("ADODB.RecordSet")<BR>Rs.Op en YourSqlQuery,Conn,3,3<BR>Response.write Rs.RecordCount<BR><BR>This give the correct recordcount. If you do not specify the Cursortype and LockType then it uses default, which is forwardonly and readonly. You need CursorType=3 to be able to counthe records.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts