<% if request.querystring ("subtool")="" then %>
<% if request.querystring ("page")="1" then %>
<%
'Control variables
maxcol=1 'Maximum number of columns. Set to one or greater
maxrow=99999 'Maximum number of rows. Set to one or greater
storycharacters=50 'Maximum number of characters in the story text display
databasesource = "crimpproductnew" 'Database source
tablename = "prodcat" 'Table in database source client data
idcol = 0 'Column containing ids
data1 = 1 'Database Column 1
data2 = 2 'Database Column 2
data3 = 3 'Database Column 3
data4 = 4 'Database Column 4
data5 = 5 'Database Column 5
data6 = 6 'Database Column 6
data7 = 7 'Database Column 7
data8 = 8 'Database Column 9
data9 = 9 'Database Column 9
data10 = 10 'Database Column 10
data11 = 11 'Database Column 11
data12 = 12 'Database Column 12
'End control variables. Do not alter any code after this.
%>
<%
'Start table generation
Set Conn = Server.CreateObject("ADODB.Connection")
Conn.Open databasesource
sql="SELECT * FROM " & tablename & " WHERE ID = " & request.querystring("ID") & " ORDER BY " & tablename & ".id ASC;"
Set RS = Conn.Execute(sql)
%>
<% if not RS.EOF then
v=RS.GetRows(1000)
trackrow=1
trackcol=1
For row = 0 to UBound(v,2) 'iterate through the rows in the variant array
if trackcol = 1 then response.write "" %>
<%=v(data1,row)%>
<%replacetext v(data2,row), chr(13), "", " ", formatted_text3a, 1
replacetext formatted_text3a, "·", "", "", formatted_text3b, 2
replacetext formatted_text3b, "m3", "", "m3", formatted_text3c, 2%>
<%=formatted_text3c%><%formatted_text3a=""
formatted_text3b=""
formatted_text3c=""%>
|
|
<%
if trackcol=maxcol then response.write ""
trackcol=trackcol+1
if trackcol > maxcol then
trackcol = 1
trackrow = trackrow + 1
if trackrow > maxrow then exit for
end if
Next
else%>
.. |
<% End if
RS.close
Conn.close %>
<% end if %>
<% end if %>
<%
' BEGIN USER CONSTANTS
Dim CONN_STRING
Dim CONN_USER
Dim CONN_PASS
' I'm using a DSN-less connection.
' To use a DSN, the format is shown on the next line:
CONN_STRING = "DSN=crimpproductnew;"
' This DB is unsecured, o/w you'd need to specify something here
CONN_USER = ""
CONN_PASS = ""
' BEGIN RUNTIME CODE
' Declare our vars
Dim iPageSize 'How big our pages are
Dim iPageCount 'The number of pages we get back
Dim iPageCurrent 'The page we want to show
Dim strOrderBy 'A fake parameter used to illustrate passing them
Dim strSQL 'SQL command to execute
Dim objPagingConn 'The ADODB connection object
Dim objPagingRS 'The ADODB recordset object
Dim iRecordsShown 'Loop controller for displaying just iPageSize records
Dim I 'Standard looping var
' Get parameters
iPageSize = 10 ' You could easily allow users to change this
' Retrieve page to show or default to 1
If Request.QueryString("page") = "" Then
iPageCurrent = 1
Else
iPageCurrent = CInt(Request.QueryString("page"))
End If
If Request.QueryString("order") = "" Then
strOrderBy = "srt"
Else
strOrderBy = Request.QueryString("order")
End If
' Build our SQL String using the parameters we just got.
'strSQL = "SELECT * FROM products ORDER BY " & strOrderBy & ";"
'strSQL = "SELECT * FROM products WHERE special = 'Yes' ORDER BY " & strOrderBy & ";"
'strSQL = "SELECT * FROM products WHERE manu = " & request.querystring("manu") & " ORDER BY " & strOrderBy & ";"
'strSQL = "SELECT * FROM products WHERE prodcategory = " & request.querystring("prodcat") & " ORDER BY " & strOrderBy & ";"
'strSQL = "SELECT * FROM products WHERE online='yes' and prodcategory = " & request.querystring("prodcat") & " AND parentcat = " & request.querystring("parentcat") & " ORDER BY " & strOrderBy & ";"
strSQL = "SELECT * FROM products WHERE online='yes' and parentcat = " & request.querystring("parentcat") & " AND prodcategory = " & request.querystring("prodcategory") & " ORDER BY " & strOrderBy & ";"
' Now we finally get to the DB work...
' Create and open our connection
set objPagingConn=server.createobject("adodb.connection")
objPagingConn.Open "crimpproductnew"
set objPagingRS=server.CreateObject("adodb.recordset")
objPagingRS.CursorLocation=3 'clientside
objPagingRS.CursorType=3 'staticrecordset
objPagingRS.PageSize=ipagesize
objPagingRS.Open strSQL, objPagingConn
' Get the count of the pages using the given page size
iPageCount = objPagingRS.PageCount
iRC = objPagingRS.RecordCount
' 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
' Check page count to prevent bombing when zero results are returned!
If iPageCount = 0 Then
Response.Write "Currently we do not have any products in this category"
Else
' Move to the selected page
objPagingRS.AbsolutePage = iPageCurrent
' Start output with a page x of n line
%>
<%
' Spacing
Response.Write vbCrLf
'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
%>
<%
'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
' Loop through our records and ouput 1 row per record
iRecordsShown = 0
Do While iRecordsShown < iPageSize And Not objPagingRS.EOF
Response.Write vbTab & "" & vbCrLf
For I = 0 To objPagingRS.Fields.Count - 142
%>
<%
'Response.Write vbTab & vbTab & " | "
'Response.Write objPagingRS.Fields(I)
'Response.Write "HS | " & vbCrLf
Next 'I
Response.Write vbTab & "" & vbCrLf
' Increment the number of records we've shown
iRecordsShown = iRecordsShown + 1
' Can't forget to move to the next record!
objPagingRS.MoveNext
Loop
' All done - close table
Response.Write "" & vbCrLf
End If
' Close DB objects and free variables
objPagingRS.Close
Set objPagingRS = Nothing
objPagingConn.Close
Set objPagingConn = Nothing
'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
' Show "previous" and "next" page links which pass the page to view
' and any parameters needed to rebuild the query. You could just as
' easily use a form but you'll need to change the lines that read
' the info back in at the top of the script. %>
<% if iPageCount >"1" then %>
<% end if %>
<% 'SHOP PRODUCT END %>
All order are carried out according to standard terms and conditions, click here for details
For details on our privacy policy please
click here
|