Hello Anyone Home?

Results 1 to 3 of 3

Thread: Hello Anyone Home?

  1. #1
    Join Date
    Dec 1969

    Default Hello Anyone Home?

    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>&#060;%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
    stud Guest

    Default Its office time honey...

    Its office time now...noones at home...<BR>

  3. #3
    Joey Guest

    Default RE: Hello Anyone Home?

    It looks as if when you go to the next page you are not passing the variables Mode and Make. There for if they are not present. Then with you If Then statement you do not allow the Recordset to be established. There for you receive an Object Required Error. Because you have not done a db connection or set up a Recordset.<BR><BR>This is what is causing the error:<BR><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>

Posting Permissions

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