%response.buffer=true%>
<%
colour1=request.cookies("estid")("colour1")
colour2=request.cookies("estid")("colour2")
colour3=request.cookies("estid")("colour3")
sitetitle=request.cookies("estid")("sitetitle")
textstd=request.cookies("estid")("textstd")
textrollover=request.cookies("estid")("textrollover")
custid=request.cookies("estid")("custid")
chkcurr=request.cookies("estid")("chkcurr")
%>
<%
'Control variables For Retreiving Currency Conversion Rates
maxcol=1 'Maximum number of columns. Set to one or greater
maxrow=50 '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 = "currdetails" 'Table in database source client data
idcol = 0 'Column containing ids
data1 = 1 'Database Column 1
data2 = 2 'Database Column 2
'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 & " ORDER BY " & tablename & ".ID ASC;"
Set RS = Conn.Execute(sql)
v=RS.GetRows(1000)
RS.close
Conn.close %>
<% dim shwchkcurr %>
<% if chkcurr ="" then
shwchkcurr="£"
currratio = 1
chkcurr ="GBP"
End if %>
<% if chkcurr = "GBP" then
shwchkcurr="£"
currratio = 1
end if%>
<% if chkcurr = "US$" then
shwchkcurr="$"
currratio = v(data1,row)
end if%>
<% if chkcurr = "Euro" then
shwchkcurr="€"
currratio = v(data2,row)
end if%>
New Products from The Crimp Company
Our New Products
<%
' 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 new='yes' 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
%>
<% end if %>
<% if objPagingRS("colour")<>"noimage" then %>
Colour
<% end if %>
<% if objPagingRS("prodname")<>"" then %>
Product
<% end if %>
<% if objPagingRS("range2")<>"" then %>
Range
<% end if %>
<% if objPagingRS("d2")<>"" then %>
d2
<% end if %>
<% if objPagingRS("W")<>"" then %>
W
<% end if %>
<% if objPagingRS("d")<>"" then %>
d
<% end if %>
<% if objPagingRS("L")<>"" then %>
L
<% end if %>
<% if objPagingRS("D3")<>"" then %>
D
<% end if %>
<% if objPagingRS("L2")<>"" then %>
L2
<% end if %>
<% if objPagingRS("B")<>"" then %>
B
<% end if %>
<% if objPagingRS("t")<>"" then %>
t
<% end if %>
<% if objPagingRS("tabs")<>"" then %>
Tabs
<% end if %>
<% if objPagingRS("areamm2")<>"" then %>
Area mm2
<% end if %>
<% if objPagingRS("forbullet")<>"" then %>
For bullet
<% end if %>
<% if objPagingRS("rating")<>"" then %>
Rating
<% end if %>
<% if objPagingRS("size")<>"" then %>
Size
<% end if %>
<% if objPagingRS("weight")<>"" then %>
Weight
<% end if %>
<% if objPagingRS("type")<>"" then %>
Type
<% end if %>
<% if objPagingRS("N1")<>"" then %>
N1
<% end if %>
<% if objPagingRS("mmW")<>"" then %>
mmW
<% end if %>
<% if objPagingRS("N")<>"" then %>
N
<% end if %>
<% if objPagingRS("pcs")<>"" then %>
pcs
<% end if %>
<% if objPagingRS("Dle")<>"" then %>
Dle
<% end if %>
<% if objPagingRS("AA")<>"" then %>
A (A)
<% end if %>
<% if objPagingRS("palmmarking")<>"" then %>
Palm Marking
<% end if %>
<% if objPagingRS("screencross")<>"" then %>
Screen Cross
<% end if %>
<% if objPagingRS("mmd")<>"" then %>
mmd
<% end if %>
<% if objPagingRS("D1")<>"" then %>
D1
<% end if %>
<% if objPagingRS("screencond")<>"" then %>
Screen Cond
<% end if %>
<% if objPagingRS("catno")<>"" then %>
Cat No.
<% end if %>
<% if objPagingRS("mmtotal")<>"" then %>
mm total
<% end if %>
<% if objPagingRS("mm")<>"" then %>
mm
<% end if %>
<% if objPagingRS("marketing")<>"" then %>
Marketing
<% end if %>
<% if objPagingRS("L1L")<>"" then %>
L1 (L)
<% end if %>
<% if objPagingRS("innerd")<>"" then %>
Inner d
<% end if %>
<% if objPagingRS("sidefeed")<>"" then %>
Side Feed
<% end if %>
<% if objPagingRS("frontfeed")<>"" then %>
Front Feed
<% end if %>
<% if objPagingRS("mma")<>"" then %>
mma
<% end if %>
<% if objPagingRS("b1")<>"" then %>
b1
<% end if %>
<% if objPagingRS("c")<>"" then %>
c
<% end if %>
<% if objPagingRS("Strandedandsolidconductors")<>"" then %>
Stranded and Solid Conductors
<% end if %>
<% if objPagingRS("TerminalM12M10")<>"" then %>
Terminal M12/M10
<% end if %>
<% if objPagingRS("TerminalM16M12")<>"" then %>
Terminal M16/M12
<% end if %>
<% if objPagingRS("Screwend")<>"" then %>
Screw End
<% end if %>
<% if objPagingRS("Fasteningkeysize")<>"" then %>
Fastening Key Size
<% end if %>
<% if objPagingRS("Screwconnector")<>"" then %>
Screw Connector
<% end if %>
<% if objPagingRS("mmL")<>"" then %>
mm L
<% end if %>
<% if objPagingRS("Do")<>"" then %>
Do
<% end if %>
<% if objPagingRS("Di")<>"" then %>
Di
<% end if %>
<% if objPagingRS("L1L1")<>"" then %>
L1 (L1)
<% end if %>
<% if objPagingRS("a")<>"" then %>
<% =objPagingRS("a")%>
<% end if %>
<% if objPagingRS("ApplicationCrimpingrange")<>"" then %>
Application Crimping Range
<% end if %>
<% if objPagingRS("DLEPV130P")<>"" then %>
DLE PV130P
<% end if %>
<% if objPagingRS("DLEPV130S")<>"" then %>
DLE PV130S
<% end if %>
<% if objPagingRS("KRKRFKSKSFDieNo")<>"" then %>
KR KRF KS KSF Die No
<% end if %>
<% if objPagingRS("KRKRFKSKSFcrimps")<>"" then %>
KR KRF KS KSF Crimps
<% end if %>
<% if objPagingRS("KRKRDKSKSDDieNo")<>"" then %>
KR KRD KS KSD Die No
<% end if %>
<% if objPagingRS("KRKRDKSKSDcrimps")<>"" then %>
KR KRD KS KSD Crimps
<% end if %>
<% if objPagingRS("KRTKSTDieNo")<>"" then %>
KRT KST Die No
<% end if %>
<% if objPagingRS("KRTKSTcrimps")<>"" then %>
KRT KST Crimps
<% end if %>
<% if objPagingRS("Hydraulicmanualcutters")<>"" then %>
Hydraulic Manual Cutters
<% end if %>
<% if objPagingRS("HKL40")<>"" then %>
HKL40
<% end if %>
<% if objPagingRS("HKL55")<>"" then %>
HKL55
<% end if %>
<% if objPagingRS("HKL85")<>"" then %>
HKL85
<% end if %>
<% if objPagingRS("Hydrauliccuttingheads")<>"" then %>
Hydraulic Cutting Heads
<% end if %>
<% if objPagingRS("KL40")<>"" then %>
KL40
<% end if %>
<% if objPagingRS("KL55")<>"" then %>
KL55
<% end if %>
<% if objPagingRS("KL85")<>"" then %>
KL85
<% end if %>
<% if objPagingRS("KL105")<>"" then %>
KL105
<% end if %>
<% if objPagingRS("Manufacturerpower")<>"" then %>
Manufacturer Power
<% end if %>
<% if objPagingRS("Typepower")<>"" then %>
Type Power
<% end if %>
<% if objPagingRS("CatnoDriving")<>"" then %>
Cat no Driving
<% end if %>
<% if objPagingRS("Shaftmm")<>"" then %>
Shaft mm
<% end if %>
<% if objPagingRS("Flangelengthmm")<>"" then %>
Flange Length mm
<% end if %>
<% if objPagingRS("Totallengthmm")<>"" then %>
Total Length mm
<% end if %>
<% if objPagingRS("kg1")<>"" then %>
kg 1
<% end if %>
<% if objPagingRS("Note")<>"" then %>
Note
<% end if %>
Quantity
Price
.
<%
' 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 & "
" & 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 %>
New Products - Page <%= iPageCurrent %> of <%= iPageCount %>
<% 'SHOP PRODUCT END %>
All orders are carried out according to standard terms and conditions, click here for details
For details on our privacy policy please
click here
<%'BEGIN sub-routine to replace text in a string
sub replacetext (textstringsource, searchfor, replacewithstart, replacewithend, textstringnew, replacemode)
'Replace text in a string
'Replacemode1 replaces front and rear and at the very end
'Replacemode2 replaces only rear and does not add to the very end of the text string
'Replacemode2 can be used to replace ' with '' for example
laststringpos=1
nextstringpos=2
do while instr(laststringpos,textstringsource,searchfor) <> 0
nextstringpos=instr(laststringpos,textstringsource,searchfor)
if replacemode=1 then
textstringnew=textstringnew & replacewithstart & mid(textstringsource,laststringpos,nextstringpos-laststringpos) & replacewithend
end if
if replacemode=2 then
textstringnew=textstringnew & mid(textstringsource,laststringpos,nextstringpos-laststringpos) & replacewithend
end if
laststringpos=nextstringpos+len(searchfor)
loop
if laststringpos <= len(textstringsource) then
if replacemode=1 then
textstringnew=textstringnew & replacewithstart & mid(textstringsource,laststringpos) & replacewithend
end if
if replacemode=2 then
textstringnew=textstringnew & mid(textstringsource,laststringpos)
end if
end if
searchfor=""
replacewithstart=""
replacewithend=""
end sub
'END sub-routine to replace text in a string%>