Object Required

Results 1 to 2 of 2

Thread: Object Required

  1. #1
    Join Date
    Dec 1969

    Default Object Required

    Sorry Re-Post - Really need help<BR><BR>Hello, I am get a Object Required Error when I try to click on my NEXT link to view the next x records in my records paging code. The error is stopping on the line that reads... rs.PageSize = intRecsPerPage <BR><BR>My code is below. Help would be greatly appreciated. <BR><BR>Thanks!! <BR><BR>%Option Explicit <BR>Dim dcnDB, strSQL, rs, i, intRecsPerPage, iPageCur, iPageCount, ItemNum, arRecs <BR>intRecsPerPage = 30 <BR>Sub GetDBase() <BR>Set dcnDB = Server.CreateObject("ADODB.COnnection") <BR>dcnDB.Open "CarsData" <BR>End Sub <BR>Sub GetAll() <BR>strSQL = "SELECT * from Inventory ORDER BY year" <BR>Set rs = Server.CreateObject("ADODB.Recordset") <BR>rs.Open strSQL, dcnDB, 1,3,1 <BR>End Sub <BR>If Request.Form("Mode") = "Model" Then <BR>If Request.Form("make") = "All" Then <BR>GetDBase <BR>GetAll <BR>Else <BR><BR>End If <BR>End If <BR>If Request("page") = "" Then <BR>iPageCur = 1 <BR>Else <BR>iPageCur = CInt(Request("page")) <BR>End If <BR>rs.PageSize = intRecsPerPage <BR><BR>iPageCount = rs.PageCount <BR>If iPageCur &#062; iPageCount Then <BR>iPageCur = iPageCount <BR>End If <BR>If iPageCur &#060; 1 Then <BR>iPageCur = 1 <BR>End If <BR>If iPageCount = 0 Then <BR>Response.Write "No Records Found" <BR>Else <BR>rs.AbsolutePage = iPageCur <BR>End If <BR>ItemNum = rs.PageSize <BR>Redim arRecs(7, ItemNum) <BR>If ItemNum &#062; 0 Then <BR>For i = 0 To UBound(arRecs, 2) -1 <BR>arRecs(0, i) = rs("year") <BR>arRecs(1, i) = rs("make") <BR>arRecs(2, i) = rs("model") <BR>arRecs(3, i) = rs("list price") <BR>arRecs(4, i) = rs("mileage") <BR>arRecs(5, i) = rs("body type") <BR>&#039;arRecs(6, i) = rs("color") <BR>rs.Movenext <BR>Next <BR>End If <BR>%&#062;

  2. #2
    Join Date
    Dec 1969

    Default RE: Object Required

    Couldn&#039;t wait 25 minutes eh?<BR><BR>Your recordset isn&#039;t open when you resubmit

Posting Permissions

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