problems with recordcount

Results 1 to 3 of 3

Thread: problems with recordcount

  1. #1
    Gerd Guest

    Default problems with recordcount

    I want to count my records from my access database, but the <BR>&#060;%response.write rs.RecordCount&#037;&#062; always show "-1"<BR>What`s wrong?<BR>Thanks

  2. #2
    Join Date
    Dec 1969
    Posts
    2,849

    Default RE: problems with recordcount

    This question has already been answered. See:<BR>http://www.aspmessageboard.com/forum/showMessage.asp?M=2706&P=1&F=21

  3. #3
    Join Date
    Dec 1969
    Posts
    69

    Default RE: problems with recordcount

    Ok, I found in Peter Norton&#039s Visial Basic 6.0 (book) an explanation that .RecordCount might return funny number if you are using ADO version prior ADO 2.0.<BR><BR>I suggest you upgrade your system. Remember old ADO is not Y2K compatible! Anyway, you can use following VB procedure for determeninig RecordCount:<BR><BR>With rs<BR> .MoveFirst<BR> If not .EOF And Not .BOF Then<BR> If .RecordCount = - 1 Then<BR> intRecordCount = 0<BR> Do<BR> intRecordCount = intRecordCount + 1<BR> .MoveNext<BR> Loop Until .EOF<BR> Else<BR> intRecordCount = .RecordCount<BR> End If<BR> End If<BR>End With<BR><BR>Latter use:<BR><BR>&#060;%response.write intRecordCount&#037;&#062;<BR><BR>Hope this would be helpful.<BR>

Posting Permissions

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