| | |
"ADODB Recordset error"
Please support our ASP advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
![]() |
•
•
Join Date: May 2004
Posts: 2
Reputation:
Solved Threads: 0
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>
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
- Active X with C# error "ActiveX cannot create an object" (C#)
- Recordset Error (Visual Basic 4 / 5 / 6)
- ADODB.Field error '80020009' (ASP)
- ABIT IC7 G "CMOS Checksum error" and "CPU has been changed or is unworkable" (Windows NT / 2000 / XP)
- ADODB.Recordset (0x800A0E78):Operation is not allowed when the object is closed. (ASP)
- asp problem ADODB.Recordset error '800a0bb9' (ASP)
- problem with ADODB.Field error '80020009' (ASP)
- ADODB.Recordset error '800a0bb9' (ASP)
Other Threads in the ASP Forum
- Previous Thread: problems selecting minimum when searching
- Next Thread: ASP Replace Function....
| Thread Tools | Search this Thread |
archive asp asp.net aspandmssqlserver2005 aspandmssqlserver2005connection aspconnection connection database databaseconnection dreamweaver excel fso iis msmsql mssql2005 mssqlserver2005 mssqlserver2005andasp mssqlserverandasp opentextfile record searchbox selectoption single specfic sqlserver sqlserverconnection windows7





