Hi All,
I keep getting error while paging thru recordset I just pasted this code from my other page and it worked fine there but will not work when I place code into html template or page layout I am using
***Error***
Error Type:
ADODB.Recordset (0x800A0BB9)
Unknown runtime error
/auto/proplist.asp, line 36
***line 36=****
RS.CursorLocation = adUseClient
RS.PageSize = Page_Size
***code****
<html>
<head>
<title>Untitled</title>
</head>
<body>
<%
Dim Connect_String
Dim Page_Size 'variable which holds the number of records to be viewed per page.
Dim Current_Page 'variable which keeps track of which page is the current page.
Dim SQL
Dim Page_Count 'variable which stores the number of pages that can be viewed.
Page_Size = 1 'here we set the number of records viewed per page to 1.
If Request("Page"
="" Then
Current_Page = 1
Else
Current_Page = CInt(Request("Page"
) 'the CInt function converts the value to an integer.
End If
Set RS = Server.CreateObject("ADODB.RecordSet"
RS.CursorLocation = adUseClient
RS.PageSize = Page_Size
SQL = "SELECT * FROM tblProperties"
RS.Open SQL, MyConn, adOpenStatic, adLockReadOnly, adCmdText
Page_Count = RS.PageCount
If 1 > Current_Page Then Current_Page = 1
If Current_Page > Page_Count Then Current_Page = Page_Count
RS.AbsolutePage = Current_Page
Do While RS.AbsolutePage = Current_Page AND Not RS.EOF
%>
<form method="post" action="db_register_user.asp">
<table width="400" border="0" align="center">
<tr align="center">
<td align="center">
<table align="right" width="100" cellspacing="2" cellpadding="2" border="1" frame="box">
<tr>
<td><a href="<%=RS.Fields("fldPicUrl"
%>" ><img height="100" width="100" border="0"src="<%=RS.Fields("fldPicUrl"
%>"></a>
</td>
</tr>
</table>
</td>
</tr>
<tr align="center">
<td align="right">Property Address :
<input type=text size="40" name="price" value="<%=(Rs.Fields.Item("fldAddress"
.value) %>">
</td>
</tr>
<tr align="left">
<td align="right">List Price :
<input type=text size="40" name="price" value="<%=(Rs.Fields.Item("fldPrice"
.value) %>">
</td>
</tr>
<tr align="center">
<td align="right">Folio :
<input type=text size="40" name="Folio" value="<%=(Rs.Fields.Item("fldFolio"
.value) %>">
</td>
</tr>
<tr align="center">
<td align="right">Legal Description :
<input type=text size="40" name="address" value="<%=(Rs.Fields.Item("fldLegalDescription"
.value) %>">
</td>
</tr>
<tr align="center">
<td align="right">Taxes :
<input type=text size="40" name="address" value="<%=(Rs.Fields.Item("fldTaxes"
.value) %>">
</td>
</tr>
<tr align="center">
<td align="right">Bed / Bath :
<input type=text size="40" name="address" value="<%=(Rs.Fields.Item("fldBedBath"
.value) %>">
</td>
</tr>
<tr align="center">
<td align="right">Square Footage :
<input type=text size="40" name="address" value="<%=(Rs.Fields.Item("fldSqrFootage"
.value) %>">
</td>
</tr>
<tr align="center">
<td align="right">Contact Info :
<input type=text size="40" name="address" value="<%=(Rs.Fields.Item("fldContactInfo"
.value) %>">
</td>
</tr>
<tr align="center">
<td align="right">LockBox Combo :
<input type=text size="40" name="address" value="<%=(Rs.Fields.Item("fldLockBox"
.value) %>">
</td>
</tr>
<tr align="center">
<td align="right">Notes :
<input type=text size="40" name="address" value="<%=(Rs.Fields.Item("fldNotes"
.value) %>">
</td>
</tr>
</table>
</form>
<%
RS.MoveNext
Loop
'clean up
RS.Close
Set RS = Nothing
MyConn.Close
Set MyConn = Nothing
Response.Write "<br>"
'below is the page navigation.
If Current_Page <> 1 Then
Response.Write "<a href=""proplist.asp?Page="
Response.Write Current_Page - 1
Response.Write """><div align=""center""><img src=""prev_1.gif"" border=""0""></div></a>" & vbCrLf
Response.Write " " & vbCrLf
End If
If Current_Page < Page_Count Then
Response.Write "<a href=""proplist.asp?Page="
Response.Write Current_Page + 1
Response.Write """><div align=""center""><img src=""next_1.gif"" border=""0""></div></a>" & vbCrLf
End IF
%>
<center>Page <%=Current_Page%> of <%=Page_Count%></center>
</body>
</html>
Thanks all
RJKealey
I keep getting error while paging thru recordset I just pasted this code from my other page and it worked fine there but will not work when I place code into html template or page layout I am using
***Error***
Error Type:
ADODB.Recordset (0x800A0BB9)
Unknown runtime error
/auto/proplist.asp, line 36
***line 36=****
RS.CursorLocation = adUseClient
RS.PageSize = Page_Size
***code****
<html>
<head>
<title>Untitled</title>
</head>
<body>
<%
Dim Connect_String
Dim Page_Size 'variable which holds the number of records to be viewed per page.
Dim Current_Page 'variable which keeps track of which page is the current page.
Dim SQL
Dim Page_Count 'variable which stores the number of pages that can be viewed.
Page_Size = 1 'here we set the number of records viewed per page to 1.
If Request("Page"
Current_Page = 1
Else
Current_Page = CInt(Request("Page"
End If
Set RS = Server.CreateObject("ADODB.RecordSet"
RS.CursorLocation = adUseClient
RS.PageSize = Page_Size
SQL = "SELECT * FROM tblProperties"
RS.Open SQL, MyConn, adOpenStatic, adLockReadOnly, adCmdText
Page_Count = RS.PageCount
If 1 > Current_Page Then Current_Page = 1
If Current_Page > Page_Count Then Current_Page = Page_Count
RS.AbsolutePage = Current_Page
Do While RS.AbsolutePage = Current_Page AND Not RS.EOF
%>
<form method="post" action="db_register_user.asp">
<table width="400" border="0" align="center">
<tr align="center">
<td align="center">
<table align="right" width="100" cellspacing="2" cellpadding="2" border="1" frame="box">
<tr>
<td><a href="<%=RS.Fields("fldPicUrl"
</td>
</tr>
</table>
</td>
</tr>
<tr align="center">
<td align="right">Property Address :
<input type=text size="40" name="price" value="<%=(Rs.Fields.Item("fldAddress"
</td>
</tr>
<tr align="left">
<td align="right">List Price :
<input type=text size="40" name="price" value="<%=(Rs.Fields.Item("fldPrice"
</td>
</tr>
<tr align="center">
<td align="right">Folio :
<input type=text size="40" name="Folio" value="<%=(Rs.Fields.Item("fldFolio"
</td>
</tr>
<tr align="center">
<td align="right">Legal Description :
<input type=text size="40" name="address" value="<%=(Rs.Fields.Item("fldLegalDescription"
</td>
</tr>
<tr align="center">
<td align="right">Taxes :
<input type=text size="40" name="address" value="<%=(Rs.Fields.Item("fldTaxes"
</td>
</tr>
<tr align="center">
<td align="right">Bed / Bath :
<input type=text size="40" name="address" value="<%=(Rs.Fields.Item("fldBedBath"
</td>
</tr>
<tr align="center">
<td align="right">Square Footage :
<input type=text size="40" name="address" value="<%=(Rs.Fields.Item("fldSqrFootage"
</td>
</tr>
<tr align="center">
<td align="right">Contact Info :
<input type=text size="40" name="address" value="<%=(Rs.Fields.Item("fldContactInfo"
</td>
</tr>
<tr align="center">
<td align="right">LockBox Combo :
<input type=text size="40" name="address" value="<%=(Rs.Fields.Item("fldLockBox"
</td>
</tr>
<tr align="center">
<td align="right">Notes :
<input type=text size="40" name="address" value="<%=(Rs.Fields.Item("fldNotes"
</td>
</tr>
</table>
</form>
<%
RS.MoveNext
Loop
'clean up
RS.Close
Set RS = Nothing
MyConn.Close
Set MyConn = Nothing
Response.Write "<br>"
'below is the page navigation.
If Current_Page <> 1 Then
Response.Write "<a href=""proplist.asp?Page="
Response.Write Current_Page - 1
Response.Write """><div align=""center""><img src=""prev_1.gif"" border=""0""></div></a>" & vbCrLf
Response.Write " " & vbCrLf
End If
If Current_Page < Page_Count Then
Response.Write "<a href=""proplist.asp?Page="
Response.Write Current_Page + 1
Response.Write """><div align=""center""><img src=""next_1.gif"" border=""0""></div></a>" & vbCrLf
End IF
%>
<center>Page <%=Current_Page%> of <%=Page_Count%></center>
</body>
</html>
Thanks all
RJKealey