Help! rs.MaxRecords doesn't work!

Results 1 to 2 of 2

Thread: Help! rs.MaxRecords doesn't work!

  1. #1
    Bob Smith Guest

    Default Help! rs.MaxRecords doesn't work!

    I wanted to limite the number of return records to only 10, so I wrote:<BR><BR>rs.MaxRecords = 10<BR><BR>sql = "select * from mytable"<BR>rs.Open sql, myConn<BR><BR>Then I checked the record set, it still returned all records! Why this happened? How to use the MaxRecords?<BR><BR>Thanks very much!<BR>

  2. #2
    sonali B. Guest

    Default RE: Help! rs.MaxRecords doesn't work!

    Hi Bob ,<BR>You van use ado property -pagesize to retrieve definite no of records from the database.<BR><BR>Pagesize Indicates how many records constitute one page in the Recordset.<BR>PageSize property is used to determine how many records make up a logical page of data<BR><BR><BR>example :::::<BR>rstEmployees.PageSize = 5<BR> intPageCount = rstEmployees.PageCount<BR> For intPage = 1 To intPageCount <BR> For intRecord = 1 To rstEmployees.PageSize<BR> strMessage = strMessage & _ rstEmployees!fname & " " & _ <BR> rstEmployees!lname & " " & _ rstEmployees!hire_date & vbCr<BR> rstEmployees.MoveNext If rstEmployees.EOF Then <BR>Exit For <BR>Next intRecord <BR><BR>Sonali B.<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