"ADODB Recordset error"

Please support our ASP advertiser: $4.95 a Month - ASP.NET Web Hosting – Click Here!
Reply

Join Date: May 2004
Posts: 2
Reputation: Shamail is an unknown quantity at this point 
Solved Threads: 0
Shamail Shamail is offline Offline
Newbie Poster

"ADODB Recordset error"

 
0
  #1
May 23rd, 2004
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>
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC