Okay yes that worked as far as getting past that error. Unfortunately it still doesnt break apart the records... I am missing something:
<%
' Get parameters
iPageSize = 10 ' You could easily allow users to change this
' Retrieve page to show or default to 1
If Request.QueryString("page"
iPageCurrent = 1
Else
iPageCurrent = CInt(Request.QueryString("
End If
Set RS = Server.CreateObject("ADODB
' If the request page falls outside the acceptable range,
' give them the closest match (1 or max)
If iPageCurrent > iPageCount Then iPageCurrent = iPageCount
If iPageCurrent < 1 Then iPageCurrent = 1
' Create recordset and set the page size
RS.PageSize = iPageSize
rs.CursorLocation = adUseClient
rs.CursorType = adOpenStatic
rs.LockType = adLockReadonly
RS.CacheSize = iPageSize
RS.open Query, Conn,,,adCmdText
iPageCount = RS.PageCount
''
%>
<tr>
<td colspan="8"><p>
<font size="+1">Page <strong><%= iPageCurrent %></strong>
of <strong><%= iPageCount %></strong></font>
</p></td>
</tr>
<tr bgcolor="#009099">
<th align="center"><font size="2" face="Arial,Helvetica">New
<th align="center"><font size="2" face="Arial,Helvetica">Yea
<th align="center"><font size="2" face="Arial,Helvetica">Mak
<th align="center"><font size="2" face="Arial,Helvetica">Mod
<th align="center"><font size="2" face="Arial,Helvetica">Pri
<th align="center"><font size="2" face="Arial,Helvetica">Col
<th align="center"><font size="2" face="Arial,Helvetica">Det
<th align="center"><font size="2" face="Arial,Helvetica">Inq
</tr>
<% If RS.BOF and RS.EOF Then %>
<tr>
<td colspan="9">
<font size="2" face="Arial,Helvetica">No Vehicles match your criteria. Please broaden your search.</font>
</td>
</tr>
<% End If %>
<%iRecordsShown = 0
Do While iRecordsShown < iPageSize And Not RS.EOF
%>
<% If RS("Ensign_NewUsed") = "N" Then
VarNewUsedDisplay = "New"
Else
VarNewUsedDisplay = "Used"
End If
%>
<%
If RS("Ensign_Location") = "BBM" Then
If instr(RS("Ensign_Sec_Locat
VarLocation = "PV"
Else
VarLocation = "OR"
End If
Else If RS("Ensign_Location") = "BB1" Then
VarLocation = "SF"
Else If RS("Ensign_Location") = "BB2" Then
VarLocation = "WX"
Else If RS("Ensign_Location") = "BB4" Then
VarLocation = "MG"
End If
End If
End If
End If
%>
<tr>
<td align="center"><font size="2"><%=VarNewUsedDisp
<td align="center"><font size="2"><%=RS("Ensign_Yea
<% ProperCase(RS("Ensign_Make
<td align="center"><font size="2"><%=VarProperCase%
<% ProperCase(RS("Ensign_Mode
<td align="center" nowrap><font size="2">
<%=VarProperCase%></font><
<td align="center" nowrap>
<%
VarSalePrice = RS("SalePrice")
VarEnsignPrice = RS("Ensign_Price")
%>
<% If VarSalePrice = 0 or VarSalePrice = " " or isnull(VarSalePrice) then %>
<% If VarEnsignPrice > 1 Then %>
<font size="2">MSRP: $<%=cl
<% Else %>
<font size="2">Call For Price</font>
<% End If %>
<% Else If VarSalePrice > 1 Then %>
<font size="2">Sale: $<%=cl
<% Else %>
<font size="2">Call For Price</font>
<% End If %>
<% End If %>
</td>
<% ProperCase(RS("Ensign_Colo
<td align="center" nowrap><font size="2"><%=VarProperCase%
<td align="center" nowrap>
<% if RS("PicturePresent") = "Yes" or (RS("Ensign_NewUsed") = "N" and RS("PicturePresent") = "No") Then %>
<% 'if RS("PicturePresent") = "Yes" and RS("Ensign_NewUsed") = "U" Then %>
<a href="submit_details.asp?d
<% else %>
<font size="2" color="black"><b>New Stock</b></font>
<% end if %>
</td>
<td align="center" nowrap><a href="buyers_quick_quote.a
</tr>
<% RS.MoveNext
Loop
%>
</table>
</td>
</tr>
<tr>
<td>
<a href="db_paging.asp?page=<
<%
' You can also show page numbers:
For I = 1 To iPageCount
If I = iPageCurrent Then
%>
<%= I %>
<%
Else
%>
<a href="db_paging.asp?page=<
<%
End If
Next 'I
If iPageCurrent < iPageCount Then
%>
<a href="db_paging.asp?page=<
<%
End If
' END RUNTIME CODE
%>
Main Topics
Browse All Topics





by: hongjunPosted on 2003-01-25 at 21:52:41ID: 7814380
Hope you have something like this
.connectio n")
.Recordset ")
<%
''
set Conn = server.createobject("adodb
Conn.Open your_connection_string
Query = "Select * From Table"
Set RS = Server.CreateObject("ADODB
' If the request page falls outside the acceptable range,
' give them the closest match (1 or max)
If iPageCurrent > iPageCount Then iPageCurrent = iPageCount
If iPageCurrent < 1 Then iPageCurrent = 1
' Create recordset and set the page size
RS.PageSize = iPageSize
rs.CursorLocation = adUseClient
rs.CursorType = adOpenStatic
rs.LockType = adLockReadonly
RS.CacheSize = iPageSize
RS.open Query, Conn,,,adCmdText
iPageCount = RS.PageCount
''
%>
Note that you can only get RS.PageCount after you have opened your recordset.
hongjun