When accessing my main page, I receive this error:
Microsoft VBScript runtime error '800a01ad'
ActiveX component can't create object
/Intranet/Fast/tblReprintProdlist.asp, line 435
The error appears to relate to the line:
Set conn=Server.CreateObject("ADODB.Connection"
Here's the code:
<%
Response.expires = 0
Response.expiresabsolute = Now() - 1
Response.addHeader "pragma", "no-cache"
Response.addHeader "cache-control", "private"
Response.CacheControl = "no-cache"
%>
<!--#include file="db.asp"-->
<!--#include file="aspmkrfn.asp"-->
<%
displayRecs = 20
recRange = 10
%>
<%
dbwhere = ""
masterdetailwhere = ""
searchwhere = ""
a_search = ""
b_search = ""
whereClause = ""
%>
<%
' Get search criteria for advance search
x_pkAuto = Request.QueryString("x_pkAuto"
z_pkAuto = Request.QueryString("z_pkAuto"
arrfieldopr = Split(z_pkAuto,","
If x_pkAuto <> "" Then
x_pkAuto = Replace(x_pkAuto,"'","''"
x_pkAuto = Replace(x_pkAuto,"[","[[]"
a_search = a_search & "[pkAuto] " 'add field
a_search = a_search & arrfieldopr(0) & " " ' add operator
If Ubound(arrfieldopr) >= 1 Then
a_search = a_search & arrfieldopr(1) 'add search prefix
End If
a_search = a_search & x_pkAuto 'add input parameter
If Ubound(arrfieldopr) >=2 Then
a_search = a_search & arrfieldopr(2) 'add search suffix
End If
a_search = a_search & " AND "
End If
x_Name = Request.QueryString("x_Name"
z_Name = Request.QueryString("z_Name"
arrfieldopr = Split(z_Name,","
If x_Name <> "" Then
x_Name = Replace(x_Name,"'","''"
x_Name = Replace(x_Name,"[","[[]"
a_search = a_search & "[Name] " 'add field
a_search = a_search & arrfieldopr(0) & " " ' add operator
If Ubound(arrfieldopr) >= 1 Then
a_search = a_search & arrfieldopr(1) 'add search prefix
End If
a_search = a_search & x_Name 'add input parameter
If Ubound(arrfieldopr) >=2 Then
a_search = a_search & arrfieldopr(2) 'add search suffix
End If
a_search = a_search & " AND "
End If
x_dtDate = Request.QueryString("x_dtDate"
z_dtDate = Request.QueryString("z_dtDate"
arrfieldopr = Split(z_dtDate,","
If x_dtDate <> "" Then
x_dtDate = Replace(x_dtDate,"'","''"
x_dtDate = Replace(x_dtDate,"[","[[]"
a_search = a_search & "[dtDate] " 'add field
a_search = a_search & arrfieldopr(0) & " " ' add operator
If Ubound(arrfieldopr) >= 1 Then
a_search = a_search & arrfieldopr(1) 'add search prefix
End If
a_search = a_search & x_dtDate 'add input parameter
If Ubound(arrfieldopr) >=2 Then
a_search = a_search & arrfieldopr(2) 'add search suffix
End If
a_search = a_search & " AND "
End If
x_TotCbOrders1 = Request.QueryString("x_TotCbOrders1"
z_TotCbOrders1 = Request.QueryString("z_TotCbOrders1"
arrfieldopr = Split(z_TotCbOrders1,","
If x_TotCbOrders1 <> "" Then
x_TotCbOrders1 = Replace(x_TotCbOrders1,"'","''"
x_TotCbOrders1 = Replace(x_TotCbOrders1,"[","[[]"
a_search = a_search & "[TotCbOrders1] " 'add field
a_search = a_search & arrfieldopr(0) & " " ' add operator
If Ubound(arrfieldopr) >= 1 Then
a_search = a_search & arrfieldopr(1) 'add search prefix
End If
a_search = a_search & x_TotCbOrders1 'add input parameter
If Ubound(arrfieldopr) >=2 Then
a_search = a_search & arrfieldopr(2) 'add search suffix
End If
a_search = a_search & " AND "
End If
x_TotPhOrders1 = Request.QueryString("x_TotPhOrders1"
z_TotPhOrders1 = Request.QueryString("z_TotPhOrders1"
arrfieldopr = Split(z_TotPhOrders1,","
If x_TotPhOrders1 <> "" Then
x_TotPhOrders1 = Replace(x_TotPhOrders1,"'","''"
x_TotPhOrders1 = Replace(x_TotPhOrders1,"[","[[]"
a_search = a_search & "[TotPhOrders1] " 'add field
a_search = a_search & arrfieldopr(0) & " " ' add operator
If Ubound(arrfieldopr) >= 1 Then
a_search = a_search & arrfieldopr(1) 'add search prefix
End If
a_search = a_search & x_TotPhOrders1 'add input parameter
If Ubound(arrfieldopr) >=2 Then
a_search = a_search & arrfieldopr(2) 'add search suffix
End If
a_search = a_search & " AND "
End If
x_TotItOrders1 = Request.QueryString("x_TotItOrders1"
z_TotItOrders1 = Request.QueryString("z_TotItOrders1"
arrfieldopr = Split(z_TotItOrders1,","
If x_TotItOrders1 <> "" Then
x_TotItOrders1 = Replace(x_TotItOrders1,"'","''"
x_TotItOrders1 = Replace(x_TotItOrders1,"[","[[]"
a_search = a_search & "[TotItOrders1] " 'add field
a_search = a_search & arrfieldopr(0) & " " ' add operator
If Ubound(arrfieldopr) >= 1 Then
a_search = a_search & arrfieldopr(1) 'add search prefix
End If
a_search = a_search & x_TotItOrders1 'add input parameter
If Ubound(arrfieldopr) >=2 Then
a_search = a_search & arrfieldopr(2) 'add search suffix
End If
a_search = a_search & " AND "
End If
x_TotFxOrders1 = Request.QueryString("x_TotFxOrders1"
z_TotFxOrders1 = Request.QueryString("z_TotFxOrders1"
arrfieldopr = Split(z_TotFxOrders1,","
If x_TotFxOrders1 <> "" Then
x_TotFxOrders1 = Replace(x_TotFxOrders1,"'","''"
x_TotFxOrders1 = Replace(x_TotFxOrders1,"[","[[]"
a_search = a_search & "[TotFxOrders1] " 'add field
a_search = a_search & arrfieldopr(0) & " " ' add operator
If Ubound(arrfieldopr) >= 1 Then
a_search = a_search & arrfieldopr(1) 'add search prefix
End If
a_search = a_search & x_TotFxOrders1 'add input parameter
If Ubound(arrfieldopr) >=2 Then
a_search = a_search & arrfieldopr(2) 'add search suffix
End If
a_search = a_search & " AND "
End If
x_TotRpOrders1 = Request.QueryString("x_TotRpOrders1"
z_TotRpOrders1 = Request.QueryString("z_TotRpOrders1"
arrfieldopr = Split(z_TotRpOrders1,","
If x_TotRpOrders1 <> "" Then
x_TotRpOrders1 = Replace(x_TotRpOrders1,"'","''"
x_TotRpOrders1 = Replace(x_TotRpOrders1,"[","[[]"
a_search = a_search & "[TotRpOrders1] " 'add field
a_search = a_search & arrfieldopr(0) & " " ' add operator
If Ubound(arrfieldopr) >= 1 Then
a_search = a_search & arrfieldopr(1) 'add search prefix
End If
a_search = a_search & x_TotRpOrders1 'add input parameter
If Ubound(arrfieldopr) >=2 Then
a_search = a_search & arrfieldopr(2) 'add search suffix
End If
a_search = a_search & " AND "
End If
x_TotCbOrders2 = Request.QueryString("x_TotCbOrders2"
z_TotCbOrders2 = Request.QueryString("z_TotCbOrders2"
arrfieldopr = Split(z_TotCbOrders2,","
If x_TotCbOrders2 <> "" Then
x_TotCbOrders2 = Replace(x_TotCbOrders2,"'","''"
x_TotCbOrders2 = Replace(x_TotCbOrders2,"[","[[]"
a_search = a_search & "[TotCbOrders2] " 'add field
a_search = a_search & arrfieldopr(0) & " " ' add operator
If Ubound(arrfieldopr) >= 1 Then
a_search = a_search & arrfieldopr(1) 'add search prefix
End If
a_search = a_search & x_TotCbOrders2 'add input parameter
If Ubound(arrfieldopr) >=2 Then
a_search = a_search & arrfieldopr(2) 'add search suffix
End If
a_search = a_search & " AND "
End If
x_TotPhOrders2 = Request.QueryString("x_TotPhOrders2"
z_TotPhOrders2 = Request.QueryString("z_TotPhOrders2"
arrfieldopr = Split(z_TotPhOrders2,","
If x_TotPhOrders2 <> "" Then
x_TotPhOrders2 = Replace(x_TotPhOrders2,"'","''"
x_TotPhOrders2 = Replace(x_TotPhOrders2,"[","[[]"
a_search = a_search & "[TotPhOrders2] " 'add field
a_search = a_search & arrfieldopr(0) & " " ' add operator
If Ubound(arrfieldopr) >= 1 Then
a_search = a_search & arrfieldopr(1) 'add search prefix
End If
a_search = a_search & x_TotPhOrders2 'add input parameter
If Ubound(arrfieldopr) >=2 Then
a_search = a_search & arrfieldopr(2) 'add search suffix
End If
a_search = a_search & " AND "
End If
x_TotItOrders2 = Request.QueryString("x_TotItOrders2"
z_TotItOrders2 = Request.QueryString("z_TotItOrders2"
arrfieldopr = Split(z_TotItOrders2,","
If x_TotItOrders2 <> "" Then
x_TotItOrders2 = Replace(x_TotItOrders2,"'","''"
x_TotItOrders2 = Replace(x_TotItOrders2,"[","[[]"
a_search = a_search & "[TotItOrders2] " 'add field
a_search = a_search & arrfieldopr(0) & " " ' add operator
If Ubound(arrfieldopr) >= 1 Then
a_search = a_search & arrfieldopr(1) 'add search prefix
End If
a_search = a_search & x_TotItOrders2 'add input parameter
If Ubound(arrfieldopr) >=2 Then
a_search = a_search & arrfieldopr(2) 'add search suffix
End If
a_search = a_search & " AND "
End If
x_TotFxOrders2 = Request.QueryString("x_TotFxOrders2"
z_TotFxOrders2 = Request.QueryString("z_TotFxOrders2"
arrfieldopr = Split(z_TotFxOrders2,","
If x_TotFxOrders2 <> "" Then
x_TotFxOrders2 = Replace(x_TotFxOrders2,"'","''"
x_TotFxOrders2 = Replace(x_TotFxOrders2,"[","[[]"
a_search = a_search & "[TotFxOrders2] " 'add field
a_search = a_search & arrfieldopr(0) & " " ' add operator
If Ubound(arrfieldopr) >= 1 Then
a_search = a_search & arrfieldopr(1) 'add search prefix
End If
a_search = a_search & x_TotFxOrders2 'add input parameter
If Ubound(arrfieldopr) >=2 Then
a_search = a_search & arrfieldopr(2) 'add search suffix
End If
a_search = a_search & " AND "
End If
x_TotRpOrders2 = Request.QueryString("x_TotRpOrders2"
z_TotRpOrders2 = Request.QueryString("z_TotRpOrders2"
arrfieldopr = Split(z_TotRpOrders2,","
If x_TotRpOrders2 <> "" Then
x_TotRpOrders2 = Replace(x_TotRpOrders2,"'","''"
x_TotRpOrders2 = Replace(x_TotRpOrders2,"[","[[]"
a_search = a_search & "[TotRpOrders2] " 'add field
a_search = a_search & arrfieldopr(0) & " " ' add operator
If Ubound(arrfieldopr) >= 1 Then
a_search = a_search & arrfieldopr(1) 'add search prefix
End If
a_search = a_search & x_TotRpOrders2 'add input parameter
If Ubound(arrfieldopr) >=2 Then
a_search = a_search & arrfieldopr(2) 'add search suffix
End If
a_search = a_search & " AND "
End If
x_TotCbOrders3 = Request.QueryString("x_TotCbOrders3"
z_TotCbOrders3 = Request.QueryString("z_TotCbOrders3"
arrfieldopr = Split(z_TotCbOrders3,","
If x_TotCbOrders3 <> "" Then
x_TotCbOrders3 = Replace(x_TotCbOrders3,"'","''"
x_TotCbOrders3 = Replace(x_TotCbOrders3,"[","[[]"
a_search = a_search & "[TotCbOrders3] " 'add field
a_search = a_search & arrfieldopr(0) & " " ' add operator
If Ubound(arrfieldopr) >= 1 Then
a_search = a_search & arrfieldopr(1) 'add search prefix
End If
a_search = a_search & x_TotCbOrders3 'add input parameter
If Ubound(arrfieldopr) >=2 Then
a_search = a_search & arrfieldopr(2) 'add search suffix
End If
a_search = a_search & " AND "
End If
x_TotPhOrders3 = Request.QueryString("x_TotPhOrders3"
z_TotPhOrders3 = Request.QueryString("z_TotPhOrders3"
arrfieldopr = Split(z_TotPhOrders3,","
If x_TotPhOrders3 <> "" Then
x_TotPhOrders3 = Replace(x_TotPhOrders3,"'","''"
x_TotPhOrders3 = Replace(x_TotPhOrders3,"[","[[]"
a_search = a_search & "[TotPhOrders3] " 'add field
a_search = a_search & arrfieldopr(0) & " " ' add operator
If Ubound(arrfieldopr) >= 1 Then
a_search = a_search & arrfieldopr(1) 'add search prefix
End If
a_search = a_search & x_TotPhOrders3 'add input parameter
If Ubound(arrfieldopr) >=2 Then
a_search = a_search & arrfieldopr(2) 'add search suffix
End If
a_search = a_search & " AND "
End If
x_TotItOrders3 = Request.QueryString("x_TotItOrders3"
z_TotItOrders3 = Request.QueryString("z_TotItOrders3"
arrfieldopr = Split(z_TotItOrders3,","
If x_TotItOrders3 <> "" Then
x_TotItOrders3 = Replace(x_TotItOrders3,"'","''"
x_TotItOrders3 = Replace(x_TotItOrders3,"[","[[]"
a_search = a_search & "[TotItOrders3] " 'add field
a_search = a_search & arrfieldopr(0) & " " ' add operator
If Ubound(arrfieldopr) >= 1 Then
a_search = a_search & arrfieldopr(1) 'add search prefix
End If
a_search = a_search & x_TotItOrders3 'add input parameter
If Ubound(arrfieldopr) >=2 Then
a_search = a_search & arrfieldopr(2) 'add search suffix
End If
a_search = a_search & " AND "
End If
x_TotFxOrders3 = Request.QueryString("x_TotFxOrders3"
z_TotFxOrders3 = Request.QueryString("z_TotFxOrders3"
arrfieldopr = Split(z_TotFxOrders3,","
If x_TotFxOrders3 <> "" Then
x_TotFxOrders3 = Replace(x_TotFxOrders3,"'","''"
x_TotFxOrders3 = Replace(x_TotFxOrders3,"[","[[]"
a_search = a_search & "[TotFxOrders3] " 'add field
a_search = a_search & arrfieldopr(0) & " " ' add operator
If Ubound(arrfieldopr) >= 1 Then
a_search = a_search & arrfieldopr(1) 'add search prefix
End If
a_search = a_search & x_TotFxOrders3 'add input parameter
If Ubound(arrfieldopr) >=2 Then
a_search = a_search & arrfieldopr(2) 'add search suffix
End If
a_search = a_search & " AND "
End If
x_TotRpOrders3 = Request.QueryString("x_TotRpOrders3"
z_TotRpOrders3 = Request.QueryString("z_TotRpOrders3"
arrfieldopr = Split(z_TotRpOrders3,","
If x_TotRpOrders3 <> "" Then
x_TotRpOrders3 = Replace(x_TotRpOrders3,"'","''"
x_TotRpOrders3 = Replace(x_TotRpOrders3,"[","[[]"
a_search = a_search & "[TotRpOrders3] " 'add field
a_search = a_search & arrfieldopr(0) & " " ' add operator
If Ubound(arrfieldopr) >= 1 Then
a_search = a_search & arrfieldopr(1) 'add search prefix
End If
a_search = a_search & x_TotRpOrders3 'add input parameter
If Ubound(arrfieldopr) >=2 Then
a_search = a_search & arrfieldopr(2) 'add search suffix
End If
a_search = a_search & " AND "
End If
If Len(a_search) > 4 Then
a_search = Mid(a_search,1,Len(a_search)-4)
End If
%>
<%
' Get search criteria for basic search
pSearch = Request.QueryString("psearch"
pSearchType = Request.QueryString("psearchType"
If pSearch <> "" Then
pSearch = Replace(pSearch,"'","''"
pSearch = Replace(pSearch,"[","[[]"
If pSearchType <> "" Then
While InStr(pSearch, " "
> 0
pSearch = Replace(pSearch, " ", " "
Wend
arpSearch = Split(Trim(pSearch), " "
For Each kw In arpSearch
b_search = b_search & "("
b_search = b_search & "[Name] LIKE '%" & Trim(kw) & "%' OR "
If Right(b_search, 4)=" OR " Then b_search = Left(b_search, Len(b_search)-4)
b_search = b_search & "
" & pSearchType & " "
Next
Else
b_search = b_search & "[Name] LIKE '%" & pSearch & "%' OR "
End If
End If
If Right(b_search, 4)=" OR " Then b_search = Left(b_search, Len(b_search)-4)
If Right(b_search, 5)=" AND " Then b_search = Left(b_search, Len(b_search)-5)
%>
<%
'Build search criteria
If a_search <> "" Then
searchwhere = a_search 'advance search
ElseIf b_search <> "" Then
searchwhere = b_search 'basic search
End If
'Save search criteria
If searchwhere <> "" Then
Session("tblReprintProd_searchwhere"
= searchwhere
'reset start record counter (new search)
startRec = 1
Session("tblReprintProd_REC"
= startRec
Else
searchwhere = Session("tblReprintProd_searchwhere"
End If
%>
<%
'Get clear search cmd
If Request.QueryString("cmd"
.Count > 0 Then
cmd = Request.QueryString("cmd"
If UCase(cmd) = "RESET" Then
'reset search criteria
searchwhere = ""
Session("tblReprintProd_searchwhere"
=searchwhere
ElseIf UCase(cmd) = "RESETALL" Then
'reset search criteria
searchwhere = ""
Session("tblReprintProd_searchwhere"
=searchwhere
End If
'reset start record counter (reset command)
startRec = 1
Session("tblReprintProd_REC"
= startRec
End If
'construct dbwhere
If masterdetailwhere <> "" Then
dbwhere = dbwhere & "(" & masterdetailwhere & "
AND "
End If
If searchwhere <> "" Then
dbwhere = dbwhere & "(" & searchwhere & "
AND "
End If
If Len(dbwhere) > 5 Then
dbwhere = Mid(dbwhere, 1, Len(dbwhere)-5) 'trim right most AND
End If
%>
<%
' Load Default Order
DefaultOrder = ""
DefaultOrderType = ""
'No Default Filter
DefaultFilter = ""
' Check for an Order parameter
OrderBy = ""
If Request.QueryString("order"
.Count > 0 Then
OrderBy = Request.QueryString("order"
' Check If an ASC/DESC toggle is required
If Session("tblReprintProd_OB"
= OrderBy Then
If Session("tblReprintProd_OT"
= "ASC" Then
Session("tblReprintProd_OT"
= "DESC"
Else
Session("tblReprintProd_OT"
= "ASC"
End if
Else
Session("tblReprintProd_OT"
= "ASC"
End If
Session("tblReprintProd_OB"
= OrderBy
Session("tblReprintProd_REC"
= 1
Else
OrderBy = Session("tblReprintProd_OB"
If OrderBy = "" Then
OrderBy = DefaultOrder
Session("tblReprintProd_OB"
= OrderBy
Session("tblReprintProd_OT"
= DefaultOrderType
End If
End If
' Open Connection to the database
Set conn = Server.CreateObject("ADODB.Connection"
conn.Open xDb_Conn_Str
' Build SQL
strsql = "SELECT * FROM [tblReprintProd]"
If DefaultFilter <> "" Then
whereClause = whereClause & "(" & DefaultFilter & "
AND "
End If
If dbwhere <> "" Then
whereClause = whereClause & "(" & dbwhere & "
AND "
End If
If Right(whereClause, 5)=" AND " Then whereClause = Left(whereClause, Len(whereClause)-5)
If whereClause <> "" Then
strsql = strsql & " WHERE " & whereClause
End If
If OrderBy <> "" Then
strsql = strsql & " ORDER BY [" & OrderBy & "] " & Session("tblReprintProd_OT"
End If
'Response.Write strsql
Set rs = Server.CreateObject("ADODB.Recordset"
rs.cursorlocation = 3
rs.Open strsql, conn, 1, 2
totalRecs = rs.RecordCount
' Check for a START parameter
If Request.QueryString("start"
.Count > 0 Then
startRec = Request.QueryString("start"
Session("tblReprintProd_REC"
= startRec
ElseIf Request.QueryString("pageno"
.Count > 0 Then
pageno = Request.QueryString("pageno"
If IsNumeric(pageno) Then
startRec = (pageno-1)*displayRecs+1
If startRec <= 0 Then
startRec = 1
ElseIf startRec >= ((totalRecs-1)\displayRecs)*displayRecs+1 Then
startRec = ((totalRecs-1)\displayRecs)*displayRecs+1
End If
Session("tblReprintProd_REC"
= startRec
Else
startRec = Session("tblReprintProd_REC"
If Not IsNumeric(startRec) Or startRec = "" Then
'reset start record counter
startRec = 1
Session("tblReprintProd_REC"
= startRec
End If
End If
Else
startRec = Session("tblReprintProd_REC"
If Not IsNumeric(startRec) Or startRec = "" Then
'reSet start record counter
startRec = 1
Session("tblReprintProd_REC"
= startRec
End If
End If
%>
<!--#include file="header.asp"-->
<form action="tblReprintProdlist.asp">
<table border="0" cellspacing="0" cellpadding="4">
<tr>
<td><font face="Book Antiqua" size="2">Quick Search (*)</font></td>
<td>
<input type="text" name="psearch" size="20">
<input type="Submit" name="Submit" value="GO">
<a href="tblReprintProdlist.asp?cmd=reset"><font face="Book Antiqua" size="2">Show all</font></a>
<a href="tblReprintProdsrch.asp"><font face="Book Antiqua" size="2">Advanced Search</font></a>
</td>
</tr>
<tr><td> </td><td><input type="radio" name="psearchtype" value="" checked><font face="Book Antiqua" size="2">Exact phrase</font> <input type="radio" name="psearchtype" value="AND"><font face="Book Antiqua" size="2">All words</font> <input type="radio" name="psearchtype" value="OR"><font face="Book Antiqua" size="2">Any word</font></td></tr>
</table>
</form>
<table border="0" cellspacing="0" cellpadding="4">
<tr>
<td><a href="tblReprintProdadd.asp"><font face="Book Antiqua" size="2">Add</font></a></td>
</tr>
</table>
<p>
<%
' Display page numbers
If totalRecs > 0 Then
rsEof = (totalRecs < (startRec + displayRecs))
' Find out if there should be Backward or Forward Buttons on the table.
If startRec = 1 Then
isPrev = False
Else
isPrev = True
PrevStart = startRec - displayRecs
If PrevStart < 1 Then PrevStart = 1 %>
<a href="tblReprintProdlist.asp?start=<%=PrevStart%>"><font face="Book Antiqua" size="2"><b>Prev</b></font></a>
<%
End If
If (isPrev OR (NOT rsEof)) Then
x = 1
y = 1
dx1 = ((startRec-1)\(displayRecs*recRange))*displayRecs*recRange+1
dy1 = ((startRec-1)\(displayRecs*recRange))*recRange+1
If (dx1+displayRecs*recRange-1) > totalRecs Then
dx2 = (totalRecs\displayRecs)*displayRecs+1
dy2 = (totalRecs\displayRecs)+1
Else
dx2 = dx1+displayRecs*recRange-1
dy2 = dy1+recRange-1
End If
While x <= totalRecs
If x >= dx1 AND x <= dx2 Then
If CLng(startRec) = CLng(x) Then %>
<font face="Book Antiqua" size="2"><b><%=y%></b></font>
<% Else %>
<a href="tblReprintProdlist.asp?start=<%=x%>"><font face="Book Antiqua" size="2"><b><%=y%></b></font></A>
<% End If
x = x + displayRecs
y = y + 1
ElseIf x >= (dx1-displayRecs*recRange) AND x <= (dx2+displayRecs*recRange) Then
If x+recRange*displayRecs < totalRecs Then %>
<a href="tblReprintProdlist.asp?start=<%=x%>"><font face="Book Antiqua" size="2"><b><%=y%>-<%=y+recRange-1%></b></font></a>
<% Else
ny=(totalRecs-1)\displayRecs+1
If ny = y Then %>
<a href="tblReprintProdlist.asp?start=<%=x%>"><font face="Book Antiqua" size="2"><b><%=y%></b></font></a>
<% Else %>
<a href="tblReprintProdlist.asp?start=<%=x%>"><font face="Book Antiqua" size="2"><b><%=y%>-<%=ny%></b></font></a>
<% End If
End If
x=x+recRange*displayRecs
y=y+recRange
Else
x=x+recRange*displayRecs
y=y+recRange
End If
Wend
End If
' Next link
If NOT rsEof Then
NextStart = startRec + displayRecs
isMore = True %>
<a href="tblReprintProdlist.asp?start=<%=NextStart%>"><font face="Book Antiqua" size="2"><b>Next</b></font></a>
<% Else
isMore = False
End If %>
<br>
<% If CLng(startRec) > CLng(totalRecs) Then startRec = totalRecs
stopRec = startRec + displayRecs - 1
recCount = totalRecs - 1
If rsEOF Then recCount = totalRecs
If stopRec > recCount Then stopRec = recCount %>
<font face="Book Antiqua" size="2"> Records <%= startRec %> to <%= stopRec %> of <%= totalRecs %></font>
<% Else %>
<font face="Book Antiqua" size="2">No records found</font>
<% End If %>
<form method="post">
<table border="0" cellspacing="1" cellpadding="5" bgcolor="#CCCCCC">
<tr bgcolor="#0099CC">
<td width="150"> <a href="tblReprintProdlist.asp?order=<%= Server.URLEncode("pkAuto"
%>"><font color="#FFFFFF"><font face="Book Antiqua" size="2">ID </font>
<% If OrderBy = "pkAuto" Then %>
<font face="Webdings">
<% If Session("tblReprintProd_OT"
= "ASC" Then %>
5
<% ElseIf Session("tblReprintProd_OT"
= "DESC" Then %>
6
<% End If %>
</font>
<% End If %>
</font></a> </td>
<td width="171"> <a href="tblReprintProdlist.asp?order=<%= Server.URLEncode("Name"
%>"><font color="#FFFFFF"><font face="Book Antiqua" size="2">Name </font>
<% If OrderBy = "Name" Then %>
<font face="Webdings">
<% If Session("tblReprintProd_OT"
= "ASC" Then %>
5
<% ElseIf Session("tblReprintProd_OT"
= "DESC" Then %>
6
<% End If %>
</font>
<% End If %>
</font></a> </td>
<td width="163"> <a href="tblReprintProdlist.asp?order=<%= Server.URLEncode("dtDate"
%>"><font color="#FFFFFF"><font face="Book Antiqua" size="2">Date </font>
<% If OrderBy = "dtDate" Then %>
<font face="Webdings">
<% If Session("tblReprintProd_OT"
= "ASC" Then %>
5
<% ElseIf Session("tblReprintProd_OT"
= "DESC" Then %>
6
<% End If %>
</font>
<% End If %>
</font></a> </td>
<td width="30"> </td>
<td width="24"> </td>
<td width="57"> </td>
<td width="33"> </td>
<td width="45"> </td>
<td width="37"> </td>
<td width="46"> </td>
</tr>
<%
'Avoid starting record > total records
If CLng(startRec) > CLng(totalRecs) Then
startRec = totalRecs
End If
'Set the last record to display
stopRec = startRec + displayRecs - 1
'Move to first record directly for performance reason
recCount = startRec - 1
If NOT rs.EOF Then
rs.MoveFirst
rs.Move startRec - 1
End If
recActual = 0
Do While (NOT rs.EOF) AND (recCount < stopRec)
recCount = recCount + 1
If CLng(recCount) >= CLng(startRec) Then
recActual = recActual + 1 %>
<%
'Set row color
bgcolor="#FFFF00"
%>
<%
' Display alternate color for rows
If recCount Mod 2 <> 0 Then
bgcolor="#CCFFFF"
End If
%>
<%
'Load Key for record
key = rs("pkAuto"
x_pkAuto = rs("pkAuto"
x_Name = rs("Name"
x_dtDate = rs("dtDate"
x_TotOrd = rs("TotOrd"
x_TotParts = rs("TotParts"
x_MinPerOrd = rs("MinPerOrd"
x_PhParts = rs("PhParts"
x_PhMinPerOrd = rs("PhMinPerOrd"
x_FaxParts = rs("FaxParts"
x_FaxMinPerOrd = rs("FaxMinPerOrd"
x_IntParts = rs("IntParts"
x_IntMinPerOrd = rs("IntMinPerOrd"
x_CbParts = rs("CbParts"
x_CbMinPerOrd = rs("CbMinPerOrd"
x_RpParts = rs("RpParts"
x_RpMinPerOrd = rs("RpMinPerOrd"
x_TotHrs = rs("TotHrs"
x_PhOrd = rs("PhOrd"
x_PhHrs = rs("PhHrs"
x_FaxOrd = rs("FaxOrd"
x_FaxHrs = rs("FaxHrs"
x_IntOrd = rs("IntOrd"
x_IntHrs = rs("IntHrs"
x_CbOrd = rs("CbOrd"
x_CbHrs = rs("CbHrs"
x_RpOrd = rs("RpOrd"
x_RpHrs = rs("RpHrs"
x_TotCbOrders1 = rs("TotCbOrders1"
x_TotPhOrders1 = rs("TotPhOrders1"
x_TotItOrders1 = rs("TotItOrders1"
x_TotFxOrders1 = rs("TotFxOrders1"
x_TotRpOrders1 = rs("TotRpOrders1"
x_TotCbOrders2 = rs("TotCbOrders2"
x_TotPhOrders2 = rs("TotPhOrders2"
x_TotItOrders2 = rs("TotItOrders2"
x_TotFxOrders2 = rs("TotFxOrders2"
x_TotRpOrders2 = rs("TotRpOrders2"
x_TotCbOrders3 = rs("TotCbOrders3"
x_TotPhOrders3 = rs("TotPhOrders3"
x_TotItOrders3 = rs("TotItOrders3"
x_TotFxOrders3 = rs("TotFxOrders3"
x_TotRpOrders3 = rs("TotRpOrders3"
%>
<tr bgcolor="<%= bgcolor %>">
<td><font face="Book Antiqua" size="2"><%= x_pkAuto %> </font></td>
<td><font face="Book Antiqua" size="2">
<%
Select Case x_Name
Case "Mary Sue" response.write "Mary Sue"
Case "Jina" response.write "Jina"
Case "Barb" response.write "Barb"
Case "Blanca" response.write "Blanca"
Case "Karen" response.write "Karen"
Case "Debbie" response.write "Debbie"
Case "Melissa" response.write "Melissa"
Case "Kam" response.write "Kam"
Case "Sherry" response.write "Sherry"
End Select
%>
</font></td>
<td><font face="Book Antiqua" size="2">
<% if isdate(x_dtDate) then response.write EW_FormatDateTime(x_dtDate,2) else response.write x_dtDate end if %>
</font></td>
<td><a href="<% key = rs("pkAuto"
: If not isnull(key) Then response.write "tblReprintProdview.asp?key=" & Server.URLEncode(key) Else response.write "javascript:alert('Invalid Record! Key is null');" End If %>"><font face="Book Antiqua" size="2">View</font></a></td>
<td><a href="<% key = rs("pkAuto"
: If not isnull(key) Then response.write "tblReprintProdedit.asp?key=" & Server.URLEncode(key) Else response.write "javascript:alert('Invalid Record! Key is null');" End If %>"><font face="Book Antiqua" size="2">Edit</font></a></td>
<td><a href="tblCallbackMainlist.asp?key_m=<%= x_pkAuto %>"><font face="Book Antiqua" size="2">Callbacks</font></a></td>
<td><a href="tblFaxMainlist.asp?key_m=<%= x_pkAuto %>"><font face="Book Antiqua" size="2">Faxes</font></a></td>
<td><a href="tblInternetMainlist.asp?key_m=<%= x_pkAuto %>"><font face="Book Antiqua" size="2">Internet</font></a></td>
<td><a href="tblPhoneMainlist.asp?key_m=<%= x_pkAuto %>"><font face="Book Antiqua" size="2">Phone</font></a></td>
<td><a href="tblReprintMainlist.asp?key_m=<%= x_pkAuto %>"><font face="Book Antiqua" size="2">Reprint</font></a></td>
</tr>
<%
End If
rs.MoveNext
Loop
%>
</table>
</form>
<%
' Close recordSet and connection
rs.Close
Set rs = Nothing
conn.Close
Set conn = Nothing %>
<!--#include file="footer.asp"-->
Microsoft VBScript runtime error '800a01ad'
ActiveX component can't create object
/Intranet/Fast/tblReprintProdlist.asp, line 435
The error appears to relate to the line:
Set conn=Server.CreateObject("ADODB.Connection"
Here's the code:
<%
Response.expires = 0
Response.expiresabsolute = Now() - 1
Response.addHeader "pragma", "no-cache"
Response.addHeader "cache-control", "private"
Response.CacheControl = "no-cache"
%>
<!--#include file="db.asp"-->
<!--#include file="aspmkrfn.asp"-->
<%
displayRecs = 20
recRange = 10
%>
<%
dbwhere = ""
masterdetailwhere = ""
searchwhere = ""
a_search = ""
b_search = ""
whereClause = ""
%>
<%
' Get search criteria for advance search
x_pkAuto = Request.QueryString("x_pkAuto"
z_pkAuto = Request.QueryString("z_pkAuto"
arrfieldopr = Split(z_pkAuto,","
If x_pkAuto <> "" Then
x_pkAuto = Replace(x_pkAuto,"'","''"
x_pkAuto = Replace(x_pkAuto,"[","[[]"
a_search = a_search & "[pkAuto] " 'add field
a_search = a_search & arrfieldopr(0) & " " ' add operator
If Ubound(arrfieldopr) >= 1 Then
a_search = a_search & arrfieldopr(1) 'add search prefix
End If
a_search = a_search & x_pkAuto 'add input parameter
If Ubound(arrfieldopr) >=2 Then
a_search = a_search & arrfieldopr(2) 'add search suffix
End If
a_search = a_search & " AND "
End If
x_Name = Request.QueryString("x_Name"
z_Name = Request.QueryString("z_Name"
arrfieldopr = Split(z_Name,","
If x_Name <> "" Then
x_Name = Replace(x_Name,"'","''"
x_Name = Replace(x_Name,"[","[[]"
a_search = a_search & "[Name] " 'add field
a_search = a_search & arrfieldopr(0) & " " ' add operator
If Ubound(arrfieldopr) >= 1 Then
a_search = a_search & arrfieldopr(1) 'add search prefix
End If
a_search = a_search & x_Name 'add input parameter
If Ubound(arrfieldopr) >=2 Then
a_search = a_search & arrfieldopr(2) 'add search suffix
End If
a_search = a_search & " AND "
End If
x_dtDate = Request.QueryString("x_dtDate"
z_dtDate = Request.QueryString("z_dtDate"
arrfieldopr = Split(z_dtDate,","
If x_dtDate <> "" Then
x_dtDate = Replace(x_dtDate,"'","''"
x_dtDate = Replace(x_dtDate,"[","[[]"
a_search = a_search & "[dtDate] " 'add field
a_search = a_search & arrfieldopr(0) & " " ' add operator
If Ubound(arrfieldopr) >= 1 Then
a_search = a_search & arrfieldopr(1) 'add search prefix
End If
a_search = a_search & x_dtDate 'add input parameter
If Ubound(arrfieldopr) >=2 Then
a_search = a_search & arrfieldopr(2) 'add search suffix
End If
a_search = a_search & " AND "
End If
x_TotCbOrders1 = Request.QueryString("x_TotCbOrders1"
z_TotCbOrders1 = Request.QueryString("z_TotCbOrders1"
arrfieldopr = Split(z_TotCbOrders1,","
If x_TotCbOrders1 <> "" Then
x_TotCbOrders1 = Replace(x_TotCbOrders1,"'","''"
x_TotCbOrders1 = Replace(x_TotCbOrders1,"[","[[]"
a_search = a_search & "[TotCbOrders1] " 'add field
a_search = a_search & arrfieldopr(0) & " " ' add operator
If Ubound(arrfieldopr) >= 1 Then
a_search = a_search & arrfieldopr(1) 'add search prefix
End If
a_search = a_search & x_TotCbOrders1 'add input parameter
If Ubound(arrfieldopr) >=2 Then
a_search = a_search & arrfieldopr(2) 'add search suffix
End If
a_search = a_search & " AND "
End If
x_TotPhOrders1 = Request.QueryString("x_TotPhOrders1"
z_TotPhOrders1 = Request.QueryString("z_TotPhOrders1"
arrfieldopr = Split(z_TotPhOrders1,","
If x_TotPhOrders1 <> "" Then
x_TotPhOrders1 = Replace(x_TotPhOrders1,"'","''"
x_TotPhOrders1 = Replace(x_TotPhOrders1,"[","[[]"
a_search = a_search & "[TotPhOrders1] " 'add field
a_search = a_search & arrfieldopr(0) & " " ' add operator
If Ubound(arrfieldopr) >= 1 Then
a_search = a_search & arrfieldopr(1) 'add search prefix
End If
a_search = a_search & x_TotPhOrders1 'add input parameter
If Ubound(arrfieldopr) >=2 Then
a_search = a_search & arrfieldopr(2) 'add search suffix
End If
a_search = a_search & " AND "
End If
x_TotItOrders1 = Request.QueryString("x_TotItOrders1"
z_TotItOrders1 = Request.QueryString("z_TotItOrders1"
arrfieldopr = Split(z_TotItOrders1,","
If x_TotItOrders1 <> "" Then
x_TotItOrders1 = Replace(x_TotItOrders1,"'","''"
x_TotItOrders1 = Replace(x_TotItOrders1,"[","[[]"
a_search = a_search & "[TotItOrders1] " 'add field
a_search = a_search & arrfieldopr(0) & " " ' add operator
If Ubound(arrfieldopr) >= 1 Then
a_search = a_search & arrfieldopr(1) 'add search prefix
End If
a_search = a_search & x_TotItOrders1 'add input parameter
If Ubound(arrfieldopr) >=2 Then
a_search = a_search & arrfieldopr(2) 'add search suffix
End If
a_search = a_search & " AND "
End If
x_TotFxOrders1 = Request.QueryString("x_TotFxOrders1"
z_TotFxOrders1 = Request.QueryString("z_TotFxOrders1"
arrfieldopr = Split(z_TotFxOrders1,","
If x_TotFxOrders1 <> "" Then
x_TotFxOrders1 = Replace(x_TotFxOrders1,"'","''"
x_TotFxOrders1 = Replace(x_TotFxOrders1,"[","[[]"
a_search = a_search & "[TotFxOrders1] " 'add field
a_search = a_search & arrfieldopr(0) & " " ' add operator
If Ubound(arrfieldopr) >= 1 Then
a_search = a_search & arrfieldopr(1) 'add search prefix
End If
a_search = a_search & x_TotFxOrders1 'add input parameter
If Ubound(arrfieldopr) >=2 Then
a_search = a_search & arrfieldopr(2) 'add search suffix
End If
a_search = a_search & " AND "
End If
x_TotRpOrders1 = Request.QueryString("x_TotRpOrders1"
z_TotRpOrders1 = Request.QueryString("z_TotRpOrders1"
arrfieldopr = Split(z_TotRpOrders1,","
If x_TotRpOrders1 <> "" Then
x_TotRpOrders1 = Replace(x_TotRpOrders1,"'","''"
x_TotRpOrders1 = Replace(x_TotRpOrders1,"[","[[]"
a_search = a_search & "[TotRpOrders1] " 'add field
a_search = a_search & arrfieldopr(0) & " " ' add operator
If Ubound(arrfieldopr) >= 1 Then
a_search = a_search & arrfieldopr(1) 'add search prefix
End If
a_search = a_search & x_TotRpOrders1 'add input parameter
If Ubound(arrfieldopr) >=2 Then
a_search = a_search & arrfieldopr(2) 'add search suffix
End If
a_search = a_search & " AND "
End If
x_TotCbOrders2 = Request.QueryString("x_TotCbOrders2"
z_TotCbOrders2 = Request.QueryString("z_TotCbOrders2"
arrfieldopr = Split(z_TotCbOrders2,","
If x_TotCbOrders2 <> "" Then
x_TotCbOrders2 = Replace(x_TotCbOrders2,"'","''"
x_TotCbOrders2 = Replace(x_TotCbOrders2,"[","[[]"
a_search = a_search & "[TotCbOrders2] " 'add field
a_search = a_search & arrfieldopr(0) & " " ' add operator
If Ubound(arrfieldopr) >= 1 Then
a_search = a_search & arrfieldopr(1) 'add search prefix
End If
a_search = a_search & x_TotCbOrders2 'add input parameter
If Ubound(arrfieldopr) >=2 Then
a_search = a_search & arrfieldopr(2) 'add search suffix
End If
a_search = a_search & " AND "
End If
x_TotPhOrders2 = Request.QueryString("x_TotPhOrders2"
z_TotPhOrders2 = Request.QueryString("z_TotPhOrders2"
arrfieldopr = Split(z_TotPhOrders2,","
If x_TotPhOrders2 <> "" Then
x_TotPhOrders2 = Replace(x_TotPhOrders2,"'","''"
x_TotPhOrders2 = Replace(x_TotPhOrders2,"[","[[]"
a_search = a_search & "[TotPhOrders2] " 'add field
a_search = a_search & arrfieldopr(0) & " " ' add operator
If Ubound(arrfieldopr) >= 1 Then
a_search = a_search & arrfieldopr(1) 'add search prefix
End If
a_search = a_search & x_TotPhOrders2 'add input parameter
If Ubound(arrfieldopr) >=2 Then
a_search = a_search & arrfieldopr(2) 'add search suffix
End If
a_search = a_search & " AND "
End If
x_TotItOrders2 = Request.QueryString("x_TotItOrders2"
z_TotItOrders2 = Request.QueryString("z_TotItOrders2"
arrfieldopr = Split(z_TotItOrders2,","
If x_TotItOrders2 <> "" Then
x_TotItOrders2 = Replace(x_TotItOrders2,"'","''"
x_TotItOrders2 = Replace(x_TotItOrders2,"[","[[]"
a_search = a_search & "[TotItOrders2] " 'add field
a_search = a_search & arrfieldopr(0) & " " ' add operator
If Ubound(arrfieldopr) >= 1 Then
a_search = a_search & arrfieldopr(1) 'add search prefix
End If
a_search = a_search & x_TotItOrders2 'add input parameter
If Ubound(arrfieldopr) >=2 Then
a_search = a_search & arrfieldopr(2) 'add search suffix
End If
a_search = a_search & " AND "
End If
x_TotFxOrders2 = Request.QueryString("x_TotFxOrders2"
z_TotFxOrders2 = Request.QueryString("z_TotFxOrders2"
arrfieldopr = Split(z_TotFxOrders2,","
If x_TotFxOrders2 <> "" Then
x_TotFxOrders2 = Replace(x_TotFxOrders2,"'","''"
x_TotFxOrders2 = Replace(x_TotFxOrders2,"[","[[]"
a_search = a_search & "[TotFxOrders2] " 'add field
a_search = a_search & arrfieldopr(0) & " " ' add operator
If Ubound(arrfieldopr) >= 1 Then
a_search = a_search & arrfieldopr(1) 'add search prefix
End If
a_search = a_search & x_TotFxOrders2 'add input parameter
If Ubound(arrfieldopr) >=2 Then
a_search = a_search & arrfieldopr(2) 'add search suffix
End If
a_search = a_search & " AND "
End If
x_TotRpOrders2 = Request.QueryString("x_TotRpOrders2"
z_TotRpOrders2 = Request.QueryString("z_TotRpOrders2"
arrfieldopr = Split(z_TotRpOrders2,","
If x_TotRpOrders2 <> "" Then
x_TotRpOrders2 = Replace(x_TotRpOrders2,"'","''"
x_TotRpOrders2 = Replace(x_TotRpOrders2,"[","[[]"
a_search = a_search & "[TotRpOrders2] " 'add field
a_search = a_search & arrfieldopr(0) & " " ' add operator
If Ubound(arrfieldopr) >= 1 Then
a_search = a_search & arrfieldopr(1) 'add search prefix
End If
a_search = a_search & x_TotRpOrders2 'add input parameter
If Ubound(arrfieldopr) >=2 Then
a_search = a_search & arrfieldopr(2) 'add search suffix
End If
a_search = a_search & " AND "
End If
x_TotCbOrders3 = Request.QueryString("x_TotCbOrders3"
z_TotCbOrders3 = Request.QueryString("z_TotCbOrders3"
arrfieldopr = Split(z_TotCbOrders3,","
If x_TotCbOrders3 <> "" Then
x_TotCbOrders3 = Replace(x_TotCbOrders3,"'","''"
x_TotCbOrders3 = Replace(x_TotCbOrders3,"[","[[]"
a_search = a_search & "[TotCbOrders3] " 'add field
a_search = a_search & arrfieldopr(0) & " " ' add operator
If Ubound(arrfieldopr) >= 1 Then
a_search = a_search & arrfieldopr(1) 'add search prefix
End If
a_search = a_search & x_TotCbOrders3 'add input parameter
If Ubound(arrfieldopr) >=2 Then
a_search = a_search & arrfieldopr(2) 'add search suffix
End If
a_search = a_search & " AND "
End If
x_TotPhOrders3 = Request.QueryString("x_TotPhOrders3"
z_TotPhOrders3 = Request.QueryString("z_TotPhOrders3"
arrfieldopr = Split(z_TotPhOrders3,","
If x_TotPhOrders3 <> "" Then
x_TotPhOrders3 = Replace(x_TotPhOrders3,"'","''"
x_TotPhOrders3 = Replace(x_TotPhOrders3,"[","[[]"
a_search = a_search & "[TotPhOrders3] " 'add field
a_search = a_search & arrfieldopr(0) & " " ' add operator
If Ubound(arrfieldopr) >= 1 Then
a_search = a_search & arrfieldopr(1) 'add search prefix
End If
a_search = a_search & x_TotPhOrders3 'add input parameter
If Ubound(arrfieldopr) >=2 Then
a_search = a_search & arrfieldopr(2) 'add search suffix
End If
a_search = a_search & " AND "
End If
x_TotItOrders3 = Request.QueryString("x_TotItOrders3"
z_TotItOrders3 = Request.QueryString("z_TotItOrders3"
arrfieldopr = Split(z_TotItOrders3,","
If x_TotItOrders3 <> "" Then
x_TotItOrders3 = Replace(x_TotItOrders3,"'","''"
x_TotItOrders3 = Replace(x_TotItOrders3,"[","[[]"
a_search = a_search & "[TotItOrders3] " 'add field
a_search = a_search & arrfieldopr(0) & " " ' add operator
If Ubound(arrfieldopr) >= 1 Then
a_search = a_search & arrfieldopr(1) 'add search prefix
End If
a_search = a_search & x_TotItOrders3 'add input parameter
If Ubound(arrfieldopr) >=2 Then
a_search = a_search & arrfieldopr(2) 'add search suffix
End If
a_search = a_search & " AND "
End If
x_TotFxOrders3 = Request.QueryString("x_TotFxOrders3"
z_TotFxOrders3 = Request.QueryString("z_TotFxOrders3"
arrfieldopr = Split(z_TotFxOrders3,","
If x_TotFxOrders3 <> "" Then
x_TotFxOrders3 = Replace(x_TotFxOrders3,"'","''"
x_TotFxOrders3 = Replace(x_TotFxOrders3,"[","[[]"
a_search = a_search & "[TotFxOrders3] " 'add field
a_search = a_search & arrfieldopr(0) & " " ' add operator
If Ubound(arrfieldopr) >= 1 Then
a_search = a_search & arrfieldopr(1) 'add search prefix
End If
a_search = a_search & x_TotFxOrders3 'add input parameter
If Ubound(arrfieldopr) >=2 Then
a_search = a_search & arrfieldopr(2) 'add search suffix
End If
a_search = a_search & " AND "
End If
x_TotRpOrders3 = Request.QueryString("x_TotRpOrders3"
z_TotRpOrders3 = Request.QueryString("z_TotRpOrders3"
arrfieldopr = Split(z_TotRpOrders3,","
If x_TotRpOrders3 <> "" Then
x_TotRpOrders3 = Replace(x_TotRpOrders3,"'","''"
x_TotRpOrders3 = Replace(x_TotRpOrders3,"[","[[]"
a_search = a_search & "[TotRpOrders3] " 'add field
a_search = a_search & arrfieldopr(0) & " " ' add operator
If Ubound(arrfieldopr) >= 1 Then
a_search = a_search & arrfieldopr(1) 'add search prefix
End If
a_search = a_search & x_TotRpOrders3 'add input parameter
If Ubound(arrfieldopr) >=2 Then
a_search = a_search & arrfieldopr(2) 'add search suffix
End If
a_search = a_search & " AND "
End If
If Len(a_search) > 4 Then
a_search = Mid(a_search,1,Len(a_search)-4)
End If
%>
<%
' Get search criteria for basic search
pSearch = Request.QueryString("psearch"
pSearchType = Request.QueryString("psearchType"
If pSearch <> "" Then
pSearch = Replace(pSearch,"'","''"
pSearch = Replace(pSearch,"[","[[]"
If pSearchType <> "" Then
While InStr(pSearch, " "
pSearch = Replace(pSearch, " ", " "
Wend
arpSearch = Split(Trim(pSearch), " "
For Each kw In arpSearch
b_search = b_search & "("
b_search = b_search & "[Name] LIKE '%" & Trim(kw) & "%' OR "
If Right(b_search, 4)=" OR " Then b_search = Left(b_search, Len(b_search)-4)
b_search = b_search & "
Next
Else
b_search = b_search & "[Name] LIKE '%" & pSearch & "%' OR "
End If
End If
If Right(b_search, 4)=" OR " Then b_search = Left(b_search, Len(b_search)-4)
If Right(b_search, 5)=" AND " Then b_search = Left(b_search, Len(b_search)-5)
%>
<%
'Build search criteria
If a_search <> "" Then
searchwhere = a_search 'advance search
ElseIf b_search <> "" Then
searchwhere = b_search 'basic search
End If
'Save search criteria
If searchwhere <> "" Then
Session("tblReprintProd_searchwhere"
'reset start record counter (new search)
startRec = 1
Session("tblReprintProd_REC"
Else
searchwhere = Session("tblReprintProd_searchwhere"
End If
%>
<%
'Get clear search cmd
If Request.QueryString("cmd"
cmd = Request.QueryString("cmd"
If UCase(cmd) = "RESET" Then
'reset search criteria
searchwhere = ""
Session("tblReprintProd_searchwhere"
ElseIf UCase(cmd) = "RESETALL" Then
'reset search criteria
searchwhere = ""
Session("tblReprintProd_searchwhere"
End If
'reset start record counter (reset command)
startRec = 1
Session("tblReprintProd_REC"
End If
'construct dbwhere
If masterdetailwhere <> "" Then
dbwhere = dbwhere & "(" & masterdetailwhere & "
End If
If searchwhere <> "" Then
dbwhere = dbwhere & "(" & searchwhere & "
End If
If Len(dbwhere) > 5 Then
dbwhere = Mid(dbwhere, 1, Len(dbwhere)-5) 'trim right most AND
End If
%>
<%
' Load Default Order
DefaultOrder = ""
DefaultOrderType = ""
'No Default Filter
DefaultFilter = ""
' Check for an Order parameter
OrderBy = ""
If Request.QueryString("order"
OrderBy = Request.QueryString("order"
' Check If an ASC/DESC toggle is required
If Session("tblReprintProd_OB"
If Session("tblReprintProd_OT"
Session("tblReprintProd_OT"
Else
Session("tblReprintProd_OT"
End if
Else
Session("tblReprintProd_OT"
End If
Session("tblReprintProd_OB"
Session("tblReprintProd_REC"
Else
OrderBy = Session("tblReprintProd_OB"
If OrderBy = "" Then
OrderBy = DefaultOrder
Session("tblReprintProd_OB"
Session("tblReprintProd_OT"
End If
End If
' Open Connection to the database
Set conn = Server.CreateObject("ADODB.Connection"
conn.Open xDb_Conn_Str
' Build SQL
strsql = "SELECT * FROM [tblReprintProd]"
If DefaultFilter <> "" Then
whereClause = whereClause & "(" & DefaultFilter & "
End If
If dbwhere <> "" Then
whereClause = whereClause & "(" & dbwhere & "
End If
If Right(whereClause, 5)=" AND " Then whereClause = Left(whereClause, Len(whereClause)-5)
If whereClause <> "" Then
strsql = strsql & " WHERE " & whereClause
End If
If OrderBy <> "" Then
strsql = strsql & " ORDER BY [" & OrderBy & "] " & Session("tblReprintProd_OT"
End If
'Response.Write strsql
Set rs = Server.CreateObject("ADODB.Recordset"
rs.cursorlocation = 3
rs.Open strsql, conn, 1, 2
totalRecs = rs.RecordCount
' Check for a START parameter
If Request.QueryString("start"
startRec = Request.QueryString("start"
Session("tblReprintProd_REC"
ElseIf Request.QueryString("pageno"
pageno = Request.QueryString("pageno"
If IsNumeric(pageno) Then
startRec = (pageno-1)*displayRecs+1
If startRec <= 0 Then
startRec = 1
ElseIf startRec >= ((totalRecs-1)\displayRecs)*displayRecs+1 Then
startRec = ((totalRecs-1)\displayRecs)*displayRecs+1
End If
Session("tblReprintProd_REC"
Else
startRec = Session("tblReprintProd_REC"
If Not IsNumeric(startRec) Or startRec = "" Then
'reset start record counter
startRec = 1
Session("tblReprintProd_REC"
End If
End If
Else
startRec = Session("tblReprintProd_REC"
If Not IsNumeric(startRec) Or startRec = "" Then
'reSet start record counter
startRec = 1
Session("tblReprintProd_REC"
End If
End If
%>
<!--#include file="header.asp"-->
<form action="tblReprintProdlist.asp">
<table border="0" cellspacing="0" cellpadding="4">
<tr>
<td><font face="Book Antiqua" size="2">Quick Search (*)</font></td>
<td>
<input type="text" name="psearch" size="20">
<input type="Submit" name="Submit" value="GO">
<a href="tblReprintProdlist.asp?cmd=reset"><font face="Book Antiqua" size="2">Show all</font></a>
<a href="tblReprintProdsrch.asp"><font face="Book Antiqua" size="2">Advanced Search</font></a>
</td>
</tr>
<tr><td> </td><td><input type="radio" name="psearchtype" value="" checked><font face="Book Antiqua" size="2">Exact phrase</font> <input type="radio" name="psearchtype" value="AND"><font face="Book Antiqua" size="2">All words</font> <input type="radio" name="psearchtype" value="OR"><font face="Book Antiqua" size="2">Any word</font></td></tr>
</table>
</form>
<table border="0" cellspacing="0" cellpadding="4">
<tr>
<td><a href="tblReprintProdadd.asp"><font face="Book Antiqua" size="2">Add</font></a></td>
</tr>
</table>
<p>
<%
' Display page numbers
If totalRecs > 0 Then
rsEof = (totalRecs < (startRec + displayRecs))
' Find out if there should be Backward or Forward Buttons on the table.
If startRec = 1 Then
isPrev = False
Else
isPrev = True
PrevStart = startRec - displayRecs
If PrevStart < 1 Then PrevStart = 1 %>
<a href="tblReprintProdlist.asp?start=<%=PrevStart%>"><font face="Book Antiqua" size="2"><b>Prev</b></font></a>
<%
End If
If (isPrev OR (NOT rsEof)) Then
x = 1
y = 1
dx1 = ((startRec-1)\(displayRecs*recRange))*displayRecs*recRange+1
dy1 = ((startRec-1)\(displayRecs*recRange))*recRange+1
If (dx1+displayRecs*recRange-1) > totalRecs Then
dx2 = (totalRecs\displayRecs)*displayRecs+1
dy2 = (totalRecs\displayRecs)+1
Else
dx2 = dx1+displayRecs*recRange-1
dy2 = dy1+recRange-1
End If
While x <= totalRecs
If x >= dx1 AND x <= dx2 Then
If CLng(startRec) = CLng(x) Then %>
<font face="Book Antiqua" size="2"><b><%=y%></b></font>
<% Else %>
<a href="tblReprintProdlist.asp?start=<%=x%>"><font face="Book Antiqua" size="2"><b><%=y%></b></font></A>
<% End If
x = x + displayRecs
y = y + 1
ElseIf x >= (dx1-displayRecs*recRange) AND x <= (dx2+displayRecs*recRange) Then
If x+recRange*displayRecs < totalRecs Then %>
<a href="tblReprintProdlist.asp?start=<%=x%>"><font face="Book Antiqua" size="2"><b><%=y%>-<%=y+recRange-1%></b></font></a>
<% Else
ny=(totalRecs-1)\displayRecs+1
If ny = y Then %>
<a href="tblReprintProdlist.asp?start=<%=x%>"><font face="Book Antiqua" size="2"><b><%=y%></b></font></a>
<% Else %>
<a href="tblReprintProdlist.asp?start=<%=x%>"><font face="Book Antiqua" size="2"><b><%=y%>-<%=ny%></b></font></a>
<% End If
End If
x=x+recRange*displayRecs
y=y+recRange
Else
x=x+recRange*displayRecs
y=y+recRange
End If
Wend
End If
' Next link
If NOT rsEof Then
NextStart = startRec + displayRecs
isMore = True %>
<a href="tblReprintProdlist.asp?start=<%=NextStart%>"><font face="Book Antiqua" size="2"><b>Next</b></font></a>
<% Else
isMore = False
End If %>
<br>
<% If CLng(startRec) > CLng(totalRecs) Then startRec = totalRecs
stopRec = startRec + displayRecs - 1
recCount = totalRecs - 1
If rsEOF Then recCount = totalRecs
If stopRec > recCount Then stopRec = recCount %>
<font face="Book Antiqua" size="2"> Records <%= startRec %> to <%= stopRec %> of <%= totalRecs %></font>
<% Else %>
<font face="Book Antiqua" size="2">No records found</font>
<% End If %>
<form method="post">
<table border="0" cellspacing="1" cellpadding="5" bgcolor="#CCCCCC">
<tr bgcolor="#0099CC">
<td width="150"> <a href="tblReprintProdlist.asp?order=<%= Server.URLEncode("pkAuto"
<% If OrderBy = "pkAuto" Then %>
<font face="Webdings">
<% If Session("tblReprintProd_OT"
5
<% ElseIf Session("tblReprintProd_OT"
6
<% End If %>
</font>
<% End If %>
</font></a> </td>
<td width="171"> <a href="tblReprintProdlist.asp?order=<%= Server.URLEncode("Name"
<% If OrderBy = "Name" Then %>
<font face="Webdings">
<% If Session("tblReprintProd_OT"
5
<% ElseIf Session("tblReprintProd_OT"
6
<% End If %>
</font>
<% End If %>
</font></a> </td>
<td width="163"> <a href="tblReprintProdlist.asp?order=<%= Server.URLEncode("dtDate"
<% If OrderBy = "dtDate" Then %>
<font face="Webdings">
<% If Session("tblReprintProd_OT"
5
<% ElseIf Session("tblReprintProd_OT"
6
<% End If %>
</font>
<% End If %>
</font></a> </td>
<td width="30"> </td>
<td width="24"> </td>
<td width="57"> </td>
<td width="33"> </td>
<td width="45"> </td>
<td width="37"> </td>
<td width="46"> </td>
</tr>
<%
'Avoid starting record > total records
If CLng(startRec) > CLng(totalRecs) Then
startRec = totalRecs
End If
'Set the last record to display
stopRec = startRec + displayRecs - 1
'Move to first record directly for performance reason
recCount = startRec - 1
If NOT rs.EOF Then
rs.MoveFirst
rs.Move startRec - 1
End If
recActual = 0
Do While (NOT rs.EOF) AND (recCount < stopRec)
recCount = recCount + 1
If CLng(recCount) >= CLng(startRec) Then
recActual = recActual + 1 %>
<%
'Set row color
bgcolor="#FFFF00"
%>
<%
' Display alternate color for rows
If recCount Mod 2 <> 0 Then
bgcolor="#CCFFFF"
End If
%>
<%
'Load Key for record
key = rs("pkAuto"
x_pkAuto = rs("pkAuto"
x_Name = rs("Name"
x_dtDate = rs("dtDate"
x_TotOrd = rs("TotOrd"
x_TotParts = rs("TotParts"
x_MinPerOrd = rs("MinPerOrd"
x_PhParts = rs("PhParts"
x_PhMinPerOrd = rs("PhMinPerOrd"
x_FaxParts = rs("FaxParts"
x_FaxMinPerOrd = rs("FaxMinPerOrd"
x_IntParts = rs("IntParts"
x_IntMinPerOrd = rs("IntMinPerOrd"
x_CbParts = rs("CbParts"
x_CbMinPerOrd = rs("CbMinPerOrd"
x_RpParts = rs("RpParts"
x_RpMinPerOrd = rs("RpMinPerOrd"
x_TotHrs = rs("TotHrs"
x_PhOrd = rs("PhOrd"
x_PhHrs = rs("PhHrs"
x_FaxOrd = rs("FaxOrd"
x_FaxHrs = rs("FaxHrs"
x_IntOrd = rs("IntOrd"
x_IntHrs = rs("IntHrs"
x_CbOrd = rs("CbOrd"
x_CbHrs = rs("CbHrs"
x_RpOrd = rs("RpOrd"
x_RpHrs = rs("RpHrs"
x_TotCbOrders1 = rs("TotCbOrders1"
x_TotPhOrders1 = rs("TotPhOrders1"
x_TotItOrders1 = rs("TotItOrders1"
x_TotFxOrders1 = rs("TotFxOrders1"
x_TotRpOrders1 = rs("TotRpOrders1"
x_TotCbOrders2 = rs("TotCbOrders2"
x_TotPhOrders2 = rs("TotPhOrders2"
x_TotItOrders2 = rs("TotItOrders2"
x_TotFxOrders2 = rs("TotFxOrders2"
x_TotRpOrders2 = rs("TotRpOrders2"
x_TotCbOrders3 = rs("TotCbOrders3"
x_TotPhOrders3 = rs("TotPhOrders3"
x_TotItOrders3 = rs("TotItOrders3"
x_TotFxOrders3 = rs("TotFxOrders3"
x_TotRpOrders3 = rs("TotRpOrders3"
%>
<tr bgcolor="<%= bgcolor %>">
<td><font face="Book Antiqua" size="2"><%= x_pkAuto %> </font></td>
<td><font face="Book Antiqua" size="2">
<%
Select Case x_Name
Case "Mary Sue" response.write "Mary Sue"
Case "Jina" response.write "Jina"
Case "Barb" response.write "Barb"
Case "Blanca" response.write "Blanca"
Case "Karen" response.write "Karen"
Case "Debbie" response.write "Debbie"
Case "Melissa" response.write "Melissa"
Case "Kam" response.write "Kam"
Case "Sherry" response.write "Sherry"
End Select
%>
</font></td>
<td><font face="Book Antiqua" size="2">
<% if isdate(x_dtDate) then response.write EW_FormatDateTime(x_dtDate,2) else response.write x_dtDate end if %>
</font></td>
<td><a href="<% key = rs("pkAuto"
<td><a href="<% key = rs("pkAuto"
<td><a href="tblCallbackMainlist.asp?key_m=<%= x_pkAuto %>"><font face="Book Antiqua" size="2">Callbacks</font></a></td>
<td><a href="tblFaxMainlist.asp?key_m=<%= x_pkAuto %>"><font face="Book Antiqua" size="2">Faxes</font></a></td>
<td><a href="tblInternetMainlist.asp?key_m=<%= x_pkAuto %>"><font face="Book Antiqua" size="2">Internet</font></a></td>
<td><a href="tblPhoneMainlist.asp?key_m=<%= x_pkAuto %>"><font face="Book Antiqua" size="2">Phone</font></a></td>
<td><a href="tblReprintMainlist.asp?key_m=<%= x_pkAuto %>"><font face="Book Antiqua" size="2">Reprint</font></a></td>
</tr>
<%
End If
rs.MoveNext
Loop
%>
</table>
</form>
<%
' Close recordSet and connection
rs.Close
Set rs = Nothing
conn.Close
Set conn = Nothing %>
<!--#include file="footer.asp"-->