 |
| Year |
Horse Capacity |
Type |
Make |
Model |
Price |
Location |
|
<%
Dim objConn
Set objConn=Server.CreateObject("ADODB.Connection")
objConn.open "Provider=SQLOLEDB; Data Source=sql.horsetrailerworld.com; User ID=d1; Password=dealer; Initial Catalog=trailern;"
Dim objRS
' @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
Dim iPageSize 'How big our pages are
Dim iPageCount 'The number of pages we get back
Dim iPageCurrent 'The page we want to show
iPageSize = 150
If Request.QueryString("page") = "" Then
iPageCurrent = 1
Else
iPageCurrent = CInt(Request.QueryString("page"))
End If
'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
Set objRS = Server.CreateObject("ADODB.Recordset")
objRS.PageSize = iPageSize
objRS.CacheSize = iPageSize
'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
Dim strSQL
'response.write "Normal Search"
strSQL = "SELECT * FROM Cust Where C_a = 'A' AND C_DC = 'towlite' Order By "&strSRT1&" Asc;"
'response.write strSQL
'@@@@@@@@@@@@@@@@@@@@@@@ need open static and lockReadonly @@@@@@@@@@@@@@@@
objRS.Open strSQL, objConn, adOpenStatic, adLockReadOnly, adCmdText
objRS.PageSize = iPageSize
iPageCount = objRS.PageCount
iRecordCount = objRS.RecordCount
'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
'response.write strSQL
If iPageCurrent > iPageCount Then iPageCurrent = iPageCount
If iPageCurrent < 1 Then iPageCurrent = 1
' Check page count to prevent bombing when zero results are returned!
If iPageCount = 0 Then %>
<%
Response.Write "**** No Records Found, Try Again! ****"
%>
<%
Else 'The Big If
objRS.AbsolutePage = iPageCurrent
'@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
%>
<%
' Now that I've got the table header, pull the records and fill in the table!
Dim strns
Dim pic
Dim strnew
Dim strid
Dim strdlr
Dim bkg 'row background color
bkg = "CCCCCC"
'da loop
iRecordsShown = 0
Do While iRecordsShown < iPageSize And Not objRS.EOF
strid = objRS("C_ID")
strnew = ""
if objRS("C_pic") = "Yes" then '------ put our camrea graphic next to the manufacturer
pic = " "
else
pic = ""
end if
if objRS("C_sold_date") > 0 then '----- put our sold graphic nect to the manufacturer
strns = " "
else
strns = ""
end if
if objRS("C_dealer") = "True" then '----- put a D in the column
strdlr = "D"
else
strdlr = ""
end if
'strBreak = Left(strLine, 1)
%>
" > sm.jpg" width="100" height="75" border="0"> |
<% = objRS("C_year")%> " ><%Response.Write objRS("C_manu")%> <%Response.Write Left(objRS("C_model"),25)%> <%=pic%><%=strns%> |
<%= FormatCurrency(objRS("C_price"),0)%> |
<%
iRecordsShown = iRecordsShown + 1
objRS.MoveNext
if bkg = "CCCCCC" then
bkg = "999999"
else
bkg = "CCCCCC"
end if
Loop
%>
<%
' All done -- Kill everything now!
objRS.close
Set objRS = Nothing
objConn.close
Set objConn = Nothing
%>
<%
End if 'The Big IF
end sub
%>
|
|