Link to home
Start Free TrialLog in
Avatar of Bob Schneider
Bob SchneiderFlag for United States of America

asked on

ASP GetRows Error

I am getting this error: Bookmark is invalid.

On this line:         IndRslts = rs.GetRows(iNumRcds, iFirstRcd)

It works fine if I take the parameters out.  iNumRcds = 75 and iFirstRcd = 1 in this case.

Thanks!
Avatar of Lee
Lee
Flag of United Kingdom of Great Britain and Northern Ireland image

Are there 75 records in the recordset?
Avatar of Bob Schneider

ASKER

There are 81
SOLUTION
Avatar of Lee
Lee
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Easy = way

Damn auto correct :-)
            sql = "SELECT pr.Bib, p.FirstName, p.LastName, p.Gender, pr.Age, ir.ChipTime, ir.FnlTime, ir.ChipStart, p.City, p.St "
            sql = sql & "FROM Participant  p INNER JOIN IndResults ir ON p.ParticipantID = ir.ParticipantID "
            sql = sql & "INNER JOIN PartRace pr ON pr.ParticipantID = p.ParticipantID "
            sql = sql & "INNER JOIN RaceData rd ON rd.RaceID = pr.RaceID AND rd.RaceID = ir.RaceID "
            sql = sql & "WHERE ir.RaceID = " & lRaceID & " AND ir.FnlTime IS NOT NULL ORDER BY ir.ChipTime"
        Else
            sql = "SELECT pr.Bib, p.FirstName, p.LastName, p.Gender, pr.Age, ir.ChipTime, ir.FnlTime, ir.ChipStart, p.City, p.St "
            sql = sql & "FROM Participant  p INNER JOIN IndResults ir ON p.ParticipantID = ir.ParticipantID "
            sql = sql & "INNER JOIN PartRace pr ON pr.ParticipantID = p.ParticipantID "
            sql = sql & "INNER JOIN RaceData rd ON rd.RaceID = pr.RaceID AND rd.RaceID = ir.RaceID "
            sql = sql & "WHERE ir.RaceID = " & lRaceID & " AND p.Gender = '" & sGender & "' AND ir.FnlTime IS NOT NULL ORDER BY ir.ChipTime"
        End If

        Set rs = Server.CreateObject("ADODB.Recordset")
        rs.Open sql, conn, 1, 2
        IndRslts = rs.GetRows(iNumRcds, iFirstRcd)
        rs.Close
        Set rs = Nothing

Open in new window

SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
I can do that but the problem with that is if there are no records it will throw an error, correct?
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Here's what I got: Current Recordset does not support bookmarks. This may be a limitation of the provider or of the selected cursortype.
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Where do I put that file and how do I reference it in my code?
Ok so how can I make this work?  I really want to be able to tell the db where to start and how many  records to et.
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
I can do that but I am trying to minimize the resource drain and I figured I could just tell it where to start and how many records to get and that would be quicker.  No?
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Got it.  I works if I just tell it how many records to get.  I built the start point into the query.
Great discussion...very informative.