I beg of you experts for your patience and expertise in resolving this error.
I have been dealing with this now for 2 days.
It really is kicking my tail.
I have 3 segments of code.
I will post the one that is having the error but if you have questions that relate to other pages, I will post the relevant part.
The error I am getting now says:
Unspecified error on this line:
rsFetch.open sSQLFetchCost, oActiveConnection, 1, 3, 1
I am just trying to make my checkout.asp file work
Please excuse the long code.
I will be more than happy to provide additional info.
Thanks in advance
I have been dealing with this now for 2 days.
It really is kicking my tail.
I have 3 segments of code.
I will post the one that is having the error but if you have questions that relate to other pages, I will post the relevant part.
The error I am getting now says:
Unspecified error on this line:
rsFetch.open sSQLFetchCost, oActiveConnection, 1, 3, 1
I am just trying to make my checkout.asp file work
Code:
<%
'procedure builds Cart contents table - isubTotal is the return value for the total
sub showCartOut(isubTotal,lCustZip,oActiveConnection)
'double quote character
q = chr(34)
%>
<table border=0 cellPadding=3 cellSpacing=2 width="100%">
<tr background="images/lefttop.jpg">
<td background="images/1_nav_color.jpg" class="body1"><FONT color=white>Product code</FONT></td>
<td background="images/1_nav_color.jpg" class="body1"><FONT color=white>Product name</FONT></td>
<td background="images/1_nav_color.jpg" class="body1"><FONT color=white>Quantity</FONT></td>
<td background="images/1_nav_color.jpg" class="body1"><FONT color=white>Unit Price</FONT></td>
<td background="images/1_nav_color.jpg" class="body1"><FONT color=white>Total</FONT></td></tr>
<%
Dim fd, sd
for sd=0 to ubound(arrCart,2)
for fd=0 to ubound(arrCart,1)
response.write "arrCart("&fd&", "&sd&"): "& arrCart(fd, sd) & "
"
next
next
%>
<%
Dim lOrderWeight
lOrderWeight = 0
isubtotal = 0
For i = 1 to scartItem
lNDPrice = arrCart(cUnitPrice,i)
lAIPPrice = arrCart(cAIPPrice,i)
lBulkPrice = arrCart(cBulkPrice,i)
lCurrentQuantity = arrCart(cQuantity,i)
lOrderWeight = lOrderWeight + (arrCart(cshippingWeight,i) * lCurrentQuantity)
lThisPrice = lNDPrice
if bIsAIPCustomer=true then
'' ***REMEMBER*** -- you need to add your AIP logic here;
'' ***you said you were going to develop this, and I don't have it, so you need to add it in here.
'' The customer is an AIP customer; give him the price.
lThisPrice = lAIPPrice
if sDisReason <>"" then
sDisReason = "You are an AIP customer."
end if
elseif cint(lCurrentQuantity)>=10 then
'' The customer qualifies for a bulk discount
lThisPrice = lBulkPrice
if sDisReason <>"" then
sDisReason = "Bulk discount applies to items ordered in quantites of 10 or more."
end if
end if
lExtPrice = lThisPrice * lCurrentQuantity
strHTML = strHTML & "<tr bgColor=navajowhite>"
strHTML = strHTML & "<td><small><input name=selected"& Cstr(i) & " type=checkbox value=""yes"" checked>"
strHTML = strHTML & arrCart(cProductCode,i) &"</small></td>"
strHTML = strHTML & "<td><small>" & arrCart(cProductname,i) & "</small></td>"
strHTML = strHTML & "<td><small><input type=""text"" size=""4"" name=""quantity" & CStr(i) & """ value=""" & arrCart(cQuantity,i) & """></small></td>"
%>
<td><small><%= FormatCurrency(lThisPrice,2)%> </small></td>
<td><small><%= FormatCurrency(lExtPrice,2) %> </small></td>
</tr>
<%
isubtotal = isubtotal + lExtPrice
Next
response.write "lOrderWeight: "& lOrderWeight & "
"
%>
<tr>
<td></td><td></td><td></td>
<td background='images/lefttop.jpg'><font color=steelblue>Sub-total</font></td>
<td bgColor=lightgoldenrodyellow> <%= FormatCurrency(isubtotal,2) %></td>
</tr>
<%
'---------add new shipping cost code----------
Dim lShippingCost
'Dim lCustZip : lCustZip = rs("czip")
lShippingCost = getShippingCharges(lCustZip, lOrderWeight, oActiveConnection)
%>
<tr>
<td></td>
<td></td>
<td align='right'>
<font color='midnightBLUE'></font>
</td>
<td background='images/lefttop.jpg' nowrap>
<font color=000000><%=lShippingCost%></font>
</td>
<td bgColor=lightgoldenrodyellow>
<%= FormatCurrency(lShippingCost,2) %>
</td>
</tr>
<%
'---------add new shipping cost code----------
isubtotal = isubtotal + lShippingCost
%>
<tr>
<td></td><td></td><td></td>
<td background='images/lefttop.jpg'><font color=steelblue>Total</font></td>
<td bgColor=lightgoldenrodyellow> <%= FormatCurrency(isubtotal,2)%></td>
</tr>
</table>
<%
response.write strHTML
end sub
'---------insert function to calculate shipping cost----------
Function getShippingCharges(lShippingZipCode, lOrderWeight, oActiveConnection)
Dim lShippingCharges
Dim sSQLFetchCost
sSQLFetchCost = "SELECT S.* FROM tblShipping S " & _
" INNER JOIN Zones Z ON " & _
" S.Zone=Z.Zone " & _
" WHERE Z.LowZip <= '" & lShippingZipCode & "' " & _
" AND Z.HighZip >= '" & lShippingZipCode & "' " & _
" AND S.fromWeight <= " & lOrderWeight & " " & _
" AND S.toWeight >= " & lOrderWeight
Dim rsFetch : set rsFetch = server.createobject("adodb.recordset")
rsFetch.open sSQLFetchCost, oActiveConnection, 1, 3, 1
if not rsFetch.eof then
lShippingCharges = rsFetch("shippingCharges")
else
lShippingCharges = 0
end if
rsFetch.close
set rsFetch = nothing
lShippingCharges = formatCurrency(lShippingCharges, 2)
getShippingCharges = lShippingCharges
End Function
'---------insert function to calculate shipping cost----------
%>
Please excuse the long code.
I will be more than happy to provide additional info.
Thanks in advance