943,832 Members | Top Members by Rank

Ad:
  • ASP Discussion Thread
  • Unsolved
  • Views: 10138
  • ASP RSS
May 23rd, 2004
0

"ADODB Recordset error"

Expand Post »
hello
please have a look at this part from a very simple code for paging. The problem is that though the recordset is fetching about 20 records and its even displaying it properly. But when I try to print record count or page count it prints either -1 or zero. Alos, Absolute page is not working as well.

<% option explicit dim intId, id, sql, intRs, intRs2, sql2, temp, poet, cnt, thisPage, rowCount, i, poet2, pgCount, recCnt, conString, gbConn
Set gbConn = Server.CreateObject("ADODB.Connection")
conString = "DBQ=" & Server.MapPath("db/geur.mdb")
gbConn.Open "DRIVER={Microsoft Access Driver (*.mdb)}; " & conString

thisPage = Trim(Request.QueryString("thisPage"))
if thisPage="" then thisPage=0
Set intRs = Server.CreateObject("ADODB.RecordSet")
sql = "select * from classics"
intRs.PageSize = 10
set intRs = gbConn.execute(sql)
pgCount = intRs.PageCount
recCnt = intRs.RecordCount
intRs.AbsolutePage = cINT(thisPage)
Response.Write "Record count is" & recCnt
Response.write "Page count is" & pgCount
while not intRs.eof
Response.write intRs.fields("poet")
intRs.movenext
wend
for i = 1 to pgCount %>
<html>
<head>
<title>Urdu</title>
</head>
<body>
<a href="http://127.0.0.1/classics.asp?poet=<% =poet %>&thisPage=<% =i-1 %>"><% =i %></a>
<% next %>
</body>
</html>
Similar Threads
Reputation Points: 10
Solved Threads: 0
Newbie Poster
Shamail is offline Offline
3 posts
since May 2004

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in ASP Forum Timeline: problems selecting minimum when searching
Next Thread in ASP Forum Timeline: ASP Replace Function....





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC