I have a problem here. I have recently upsized a shop to SQL server.
I am running on a Windows 2003 Server running multiple websites. I
have full access to this server.
The shop works fine and orders are taken into the database after the SQL upsize.
There is one page that is causing major problems.
When this page is brought up, it maxes the CPU to 100% and i can see
dllhost.exe is maxed out (one instance of it)
I have looked thru my code for infinite loops and have debugged and i
know the issue lies somewhere in the code i am posting here. anyone
who can help, i would appreciate it.
Keep in mind that with the access database the page that causes the
CPU to max out runs fine.
========================================================
<%
'THIS PAGE DISPLAYS A CUSTOMER ORDER
'IF THERE IS NO ORDER ID SEND THEM TO THE MAIN ADMIN PAGE
IF Request("txtOrderID") = "" THEN
Response.Redirect("admin.asp")
END IF
'create recordset to show categories from database
Dim rsOrder, vDesc, sqlOrder, vShipCharge, vShipChargeNote, vOrderTotal
'Set rsOrder = Server.CreateObject ("ADODB.Recordset")
'CREATE THE SQL STATEMENT
sqlOrder = "SELECT orders.OrderID as OrderID, orders.CustID as CustID,
orders.OrderDate as OrderDate, Customers.Phone as Phone,
orders.OrderTax as OrderTax, "_
& "orders.CCardType as CardType, orders.x_Code as x_Code,
orders.ccardnumber as CardNumber, orders.CCardName as CardName,
orders.CCardExpireDate as CardDate, "_
& "orders.OrderNote as OrderNote, customers.NameFirst as NameFirst,
customers.NameLast as NameLast, customers.Email as Email, "_
& "customers.Address1 as Address1, customers.Address2 as Address2,
customers.City as City, "_
& "customers.State as State, customers.Country as Country,
customers.Zip as Zip, products.Name as ProdName, "_
& "orderitems.Price as Price, orderitems.QTY as QTY,
[products]![Price]*[orderitems]![QTY]+OrderItems.Shipping AS SubTotal,
"_
& "orderitems.ProductID as ProdID, OrderItems.Shipping as Shipping,
orders.ShipChargeNote as ShipChargeNote, "_
& "orders.ShipName as ShipName, orders.ShipAddress1 as
ShipAddress1, orders.ShipAddress2 as ShipAddress2, orders.ShipCity as
ShipCity, "_
& "orders.ShipCharge as ShipCharge, orders.ShipZip as ShipZip,
orders.ShipState as ShipState, orders.ShipCountry as ShipCountry, "_
& "orders.OrderTotal as OrderTotal, orders.CCResponseCode as
CCResponseCode, orders.CCResponseReason as CCResponseReason "_
& "FROM (categories INNER JOIN products ON categories.CatID =
products.CatID) INNER JOIN ((customers INNER JOIN orders ON
customers.CustID = orders.CustID) INNER JOIN orderitems ON
orders.OrderID = orderitems.OrderID) ON products.ProductID =
orderitems.ProductID "_
& "WHERE orders.OrderID = "_
& Request("txtOrderID")
'Response.Write sqlOrder & "<br>" & vbnewline
rsOrder.Open sqlOrder, dbc, adOpenForwardOnly,adLockReadOnly
IF NOT rsOrder.EOF THEN
DIM vCardNumber, vCardDate, vCardName, vCardType, vCode, vTax,
vOrderStatus, vOrderStatusReason, vOrderSubtotal, vState
if rsOrder("shipCharge") > "" then
vShipCharge = rsOrder("ShipCharge")
else
vShipCharge = 0.00
end if
vShipChargeNote = rsOrder("ShipChargeNote")
vOrderTotal = rsOrder("OrderTotal")
vTax = rsOrder("OrderTax")
vCardNumber = rsOrder("CardNumber")
vCardDate = rsOrder("CardDate")
vCardName = rsOrder("CardName")
vCardType = rsOrder("CardType")
vCode = rsOrder("x_Code")
vOrderStatus = rsOrder("CCResponseCode")
if isNull(rsOrder("CCResponseReason")) then
vOrderStatusReason = "none"
else
vOrderStatusReason = rsOrder("CCResponseReason")
end if
vState = rsOrder("State")
vOrderSubtotal = 0
vDesc=Request("txtItemDesc")
%>
<tr>
<td colspan=2><br>
<table width=100% align=center border=0 cellspacing=0 cellpadding=0>
<tr>
<td align=left
colspan=2><b><%=UCase(cName)%> INVOICE</b><br> <%=cAddress%><br>
<%=cCSZ%><br> Phone: <%=cPhone%><br> Fax: <%=cFax%><br> </td>
<td align=right valign=Top colspan=2> <b>ORDER#:
<%=rsOrder("OrderID")%></b><br>
Customer#: <%=rsOrder("CustID")%><br>
Order Date: <%=rsOrder("OrderDate")%><br> </td>
</tr>
<tr>
<td colspan=4> </td>
</tr>
<tr>
<td colspan=4><hr width=100% size=1 noshade color=SILVER></td>
</tr>
<tr bgcolor=Silver>
<td align=Left nowrap colspan=2> <b>BILLING ADDRESS:</b> </td>
<td align=Left nowrap colspan=2> <b>SHIPPING ADDRESS:</b> </td>
</tr>
<tr>
<td colspan=4><hr width=100% size=1 noshade color=SILVER></td>
</tr>
<tr>
<td align=left nowrap><a
href="invoice_billing.asp?txtOrderID=<%=rsOrder("OrderID")%>"
target="_blank">BILLING
INVOICE</a> </td>
<td align=left> </td>
<td align=left nowrap><a
href="invoice_shipping.asp?txtOrderID=<%=rsOrder("OrderID")%>"
target="_blank">SHIPPING
INVOICE</a> </td>
<td align=left> </td>
</tr>
<tr>
<td align=left nowrap><a
href="label_billing.asp?txtOrderID=<%=rsOrder("OrderID")%>"
target="_blank">BILLING
LABEL</a></td>
<td align=left> </td>
<td align=left nowrap><a
href="label_shipping.asp?txtOrderID=<%=rsOrder("OrderID")%>"
target="_blank">SHIPPING
LABEL</a><br> </td>
<td align=left> </td>
</tr>
<tr>
<td align=left width="10%" nowrap><b>Name: </b></td>
<td align=left
width="40%"><%=ReplaceOut(UCase(rsOrder("NameFirst")))%> <%=ReplaceOut(UCase(rsOrder("NameLast")))%></td>
<td align=left width="12%" nowrap><b>Name: </b></td>
<td align=left width="38%"><%=ReplaceOut(UCase(rsOrder("ShipName")))%></td>
</tr>
<tr>
<td align=left width="10%" nowrap><b>Company: </b></td>
<td align=left width="40%"><%=ReplaceOut(UCase(rsOrder("Address2")))%></td>
<td align=left width="12%" nowrap><b>Company: </b></td>
<td align=left width="38%"><%=UCase(rsOrder("ShipAddress2"))%></td>
</tr>
<tr>
<td align=left width="10%" nowrap><b>Address: </b></td>
<td align=left width="40%"><%=ReplaceOut(UCase(rsOrder("Address1")))%></td>
<td align=left width="12%" nowrap><b>Address: </b></td>
<td align=left width="38%"><%=UCase(rsOrder("ShipAddress1"))%></td>
</tr>
<tr>
<td align=left width="10%" nowrap><b>CSZ: </b></td>
<td align=left width="40%"><%=UCase(rsOrder("City"))%>,
<% if Ucase(rsOrder("State")) <> "NONE" then %>
<%=UCase(rsOrder("State"))%>
<% end if %>
<%=UCase(rsOrder("Zip"))%></td>
<td align=left width="12%" nowrap><b>CSZ: </b></td>
<td align=left width="38%"><%=UCase(rsOrder("ShipCity"))%>,
<% if Ucase(rsOrder("ShipState")) <> "NONE" then %>
<%=UCase(rsOrder("ShipState"))%>
<% end if %>
<%=UCase(rsOrder("ShipZip"))%></td>
</tr>
<tr>
<td align=left width="10%" nowrap><b>Country: </b></td>
<td align=left width="40%"><%=UCase(rsOrder("Country"))%></td>
<td align=left width="12%" nowrap><b>Country: </b></td>
<td align=left width="38%"><%=UCase(rsOrder("ShipCountry"))%></td>
</tr>
<tr>
<td align=left width="10%" nowrap><b>Email: </b></td>
<td align=left width="40%"><a
href="mailto:<%=rsOrder("Email")%>"><%=rsOrder("Email")%></a></td>
<td align=left width="12%" nowrap><a
href="label_shipping.asp?txtOrderID=<%=rsOrder("OrderID")%>"
target="_blank"><br>
</a></td>
<td align=left width="38%"> </td>
</tr>
<tr>
<td align=left width="10%" nowrap><b>Phone: </b></td>
<td align=left width="40%"><%= rsOrder("Phone") %></td>
<td align=left width="12%" nowrap><a
href="label_shipping.asp?txtOrderID=<%=rsOrder("OrderID")%>"
target="_blank"><br>
</a></td>
<td align=left width="38%"> </td>
</tr>
<tr>
<td colspan=4><hr width=100% size=1 noshade color=silver></td>
</tr>
<tr>
<td colspan=4> <table border=0 cellpadding=0 cellspacing=0 width=100%>
<tr bgcolor=Silver>
<td align=left><b>Qty </b></td>
<td align=left><b>Item </b></td>
<td align=right><b>Each </b></td>
<td align=right><b>Shipping </b></td>
<td align=right><b>SubTotal </b></td>
</tr>
<%
'LOOP THROUGH THE ITEMS IN THIS ORDER
rsOrder.MoveFirst
While Not rsOrder.EOF
vOption = " "
vOptionPrice = "0.00"
'CREATE RECORDSET TO SHOW ORDER ITEM OPTIONS
Dim rsItemOptions, sqlItemOptions, vOption, vOptionPrice, vOptionPriceSum
Set rsItemOptions = Server.CreateObject ("ADODB.Recordset")
sqlItemOptions = "SELECT OrderItems.ProductID,
ProductOptions.OptionName, ProductOptionItems.ItemDesc,
OrderItemOptions.OptionItemPrice "
sqlItemOptions = sqlItemOptions & " FROM ProductOptions INNER JOIN
(ProductOptionItems INNER JOIN (OrderItems INNER JOIN OrderItemOptions
ON OrderItems.ItemID = OrderItemOptions.ItemID) ON
ProductOptionItems.OptionItemID = OrderItemOptions.OptionItemID) ON
ProductOptions.OptionID = ProductOptionItems.OptionID "
sqlItemOptions = sqlItemOptions & " WHERE OrderItems.OrderID = "
sqlItemOptions = sqlItemOptions & rsOrder("OrderID")
sqlItemOptions = sqlItemOptions & " AND OrderItems.ProductID = "
sqlItemOptions = sqlItemOptions & rsOrder("ProdID")
sqlItemOptions = sqlItemOptions & ";"
rsItemOptions.Open sqlItemOptions, dbc, adOpenForwardOnly,adLockReadOnly
IF NOT rsItemOptions.EOF THEN
rsItemOptions.MoveFirst
While Not rsItemOptions.EOF
vOptionPrice = vOptionPrice + rsItemOptions("OptionItemPrice")
rsItemOptions.MoveNext
Wend
rsItemOptions.MoveFirst
END IF
%>
<tr valign="middle">
<td colspan=5><hr width=100% size=1 noshade color=silver></td>
</tr>
<tr valign="middle">
<td align=left><%=rsOrder("QTY")%> </td>
<td align=left><%=ReplaceOut(rsOrder("ProdName"))%> </td>
<td align=right><%=cCurrencyFormat &
FormatNumber(rsOrder("Price") + vOptionPrice,2)%> </td>
<td align=right><%=cCurrencyFormat &
FormatNumber(rsOrder("Shipping"),2)%> </td>
<td align=right><%=cCurrencyFormat &
FormatNumber((rsOrder("Price") +
vOptionPrice)*rsOrder("QTY")+rsOrder("Shipping"),2)%> </td>
<%
' Capture the Item and Order subtotals for use later.
dim vItemSubtotal
vItemSubtotal = (rsOrder("Price") + vOptionPrice) *
rsOrder("QTY") + rsOrder("Shipping")
vOrderSubtotal = vOrderSubtotal + vItemSubtotal
%>
</tr>
<%'THIS IS WHERE WE WRITE THE OPTIONS IF THERE ARE ANY%>
<tr>
<td align=left> </td>
<td align=left><font size=1>
<%
IF NOT rsItemOptions.EOF THEN
rsItemOptions.MoveFirst
While Not rsItemOptions.EOF
Response.Write(" " &
ReplaceOut(rsItemOptions("OptionName")) & ": " &
ReplaceOut(rsItemOptions("ItemDesc")) & " Add: " &
cCurrencyFormat & FormatNumber(rsItemOptions("OptionItemPrice"),2) &
"<br>")
'GO GET THE NEXT ITEM OPTION
rsItemOptions.MoveNext
Wend
'rsItemOptions.Close
END IF
%>
</font></td>
<td align=right> </td>
<td align=right> </td>
<td align=right> </td>
</tr>
<%
'KEEP A RUNNING
vOptionPriceSum = vOptionPriceSum + vOptionPrice
'GO GET THE NEXT ITEM
rsOrder.MoveNext
Wend
%>
</table>
<%
'Store the previously calculated OrderSubtotal in the Session
Session("OrderSubtotal") = FormatNumber(vOrderSubtotal, 2)
%> </td>
</tr>
<tr>
<td colspan=4><hr width=100% size=1 noshade color=silver></td>
</tr>
<tr bgcolor=Silver>
<td colspan=4> </td>
</tr>
<form method=POST
action="order_report.asp?mode=adjust&txtOrderID=<%=Request("txtOrderID")%>">
<%
IF Request("txtOrderID")<>"" AND Request("mode")="adjust" THEN
Dim sqlOrderStatAdjust, vAdjMsg
sqlOrderStatAdjust = "UPDATE Orders SET ShipCharge = '" &
Request.Form("ShipCharge") _
& "', ShipChargeNote = '" & Request.Form("ShipChargeNote") _
& "', OrderTotal = '" & FormatNumber(Session("OrderSubtotal") -
Request.Form("ShipCharge") + ((Session("OrderSubtotal") -
Request.Form("ShipCharge")) * Session("TaxRate")), 2) _
& "', OrderTax = '" & FormatNumber((Session("OrderSubtotal") -
Request.Form("ShipCharge")) * Session("TaxRate"), 2) _
& "' WHERE OrderID = " & Request("txtOrderID") & ";"
ON ERROR RESUME NEXT
dbc.execute(sqlOrderStatAdjust)
IF ERR.number <> 0 THEN
vAdjMsg = Err.Description
ELSE
vAdjMsg = "Updated Successfully"
vShipCharge = Request.Form("ShipCharge")
vShipChargeNote = Request.Form("ShipChargeNote")
END IF
END IF
%>
<tr>
<td align=left colspan=2> Change Adjustment: <%
If vShipCharge > 1 Then %> <input name="ShipCharge" type="text"
id="ShipCharge" value="<%= FormatNumber(vShipCharge, 2) %>">
<% Else %> <input name="ShipCharge" type="text"
id="ShipCharge" value="0.00">
<% End If %> </td>
<td width="12%" align=right valign="top" nowrap>Current
Adjustment: </td>
<td align=right valign="top">-
<%
if vShipCharge > 1 then
Response.Write(cCurrencyFormat & FormatNumber(vShipCharge,2))
else
Response.Write(cCurrencyFormat & "0.00")
end if %></td>
</tr>
<tr>
<td colspan="2" align=left>Change Note: <input
name="ShipChargeNote" type="text" id="ShipChargeNote" value="<%=
vShipChargeNote %>" size="50" maxlength="50">
</td>
<td align=right valign="top">Adjustment Note: </td>
<td align="right" valign="top"> <% if Len(vShipChargeNote) >
1 then %> <%= vShipChargeNote %> <% else %> <i><none></i> <% end
if %> </td>
<%' v 5.5 %>
</tr>
<tr>
<td> </td>
<td align="right"></td>
<td align="right" valign="bottom">Sub Total: </td>
<td align="right" valign="bottom"><% vOrderSubtotal =
vOrderSubtotal - vShipCharge %> <%= cCurrencyFormat &
FormatNumber(vOrderSubtotal, 2) %></td>
</tr>
<tr>
<td colspan="2" align=right> </td>
<td width="12%" align=right valign="bottom">Tax: </td>
<%' v 5.5 %>
<td align=right valign="bottom"> <%
'GRAB THE TAX RATE IF THERE IS ONE
DIM sqlTax, rsTax, vTaxRate
'CREATE A RECORDSET
SET rsTax = Server.CreateObject ("adodb.Recordset")
'sqlTax="SELECT * FROM TAX WHERE STATE = '" & vState & "'
AND ActiveIndicator = 'Y';"
sqlTax="SELECT * FROM TAX WHERE STATE = '" & vState & "' AND
ActiveIndicator = 'Y';"
rsTax.Open sqlTax, dbc, adOpenForwardOnly, adLockReadOnly
IF NOT rsTax.EOF THEN
vTaxRate = rsTax("rate") / 100
ELSE
vTaxRate = 0
END IF
' Store the tax rate in the session
Session("TaxRate") = vTaxRate
rsTax.Close
vTax = vTaxRate * vOrderSubtotal
vTax = Round(vTax, 2)
'vOrderTotal = vOrderSubtotal + vTax
Response.Write cCurrencyFormat & FormatNumber(vTax, 2)
%></td>
</tr>
<tr>
<td align=left> </td>
<td align=right> </td>
<td width="12%" align=right valign="bottom">Total: </td>
<td align=right valign="bottom"> <% vOrderTotal =
vOrderSubtotal + vTax %> <%=cCurrencyFormat &
FormatNumber(vOrderTotal,2)%></td>
</tr>
<tr>
<td align=right colspan=4><font
color=GREEN><b> <%=vAdjMsg%></b></font></td>
</tr>
<tr align="right">
<td colspan=4> <input type=SUBMIT value="Update" name=btnSubmit>
<input type=RESET value="Reset" name=btnReset></td>
</tr>
</form>
<tr>
<td colspan=4><hr width=100% size=1 noshade color=silver></td>
</tr>
<tr bgcolor=Silver>
<td colspan=4><b>Payment Details</b></td>
</tr>
<tr>
<td colspan=4><hr width=100% size=1 noshade color=silver></td>
</tr>
<tr>
<td align=left> </td>
<td align=left> </td>
<td align=right nowrap>Card Type: </td>
<td align=right><%=vCardType%> </td>
</tr>
<tr>
<td align=left> </td>
<td align=left> </td>
<td align=right nowrap>Card Name: </td>
<td align=right><%=ReplaceOut(vCardName)%> </td>
</tr>
<tr>
<td align=left> </td>
<td align=left> </td>
<td align=right nowrap>Card Number: </td>
<td align=right><%=DecryptIt(vCardNumber)%> </td>
</tr>
<tr>
<td align=left> </td>
<td align=left> </td>
<td align=right nowrap>Card Date: </td>
<td align=right><%=vCardDate%> </td>
</tr>
<tr>
<td height="16" align=left> </td>
<td align=left> </td>
<td align=right nowrap>Access Code:</td>
<td align=right><%=vCode%> </td>
</tr>
<tr>
<td colspan=4><hr width=100% size=1 noshade color=silver></td>
</tr>
<tr bgcolor=Silver>
<td colspan=4><b>Payment Status</b></td>
</tr>
<tr>
<td colspan=4><hr width=100% size=1 noshade color=silver></td>
</tr>
<form method=POST
action="order_report.asp?mode=update&txtOrderID=<%=Request("txtOrderID")%>">
<tr>
<td align=left nowrap>Status: </td>
<%'IF THERE IS NO CCRESPONSECODE OR IF THE CCRESPONSECODE=1
THEN THE ORDER HAS BEEN APPROVED. ELSE DECLINED%>
<td colspan=3 align=right><select name="selOrderStat">
<%
IF Request("txtOrderID")<>"" AND Request("mode")="update" THEN
Dim sqlOrderStatUpdate, vUpdMsg
sqlOrderStatUpdate = "UPDATE ORDERS SET CCResponseCode = '"
sqlOrderStatUpdate = sqlOrderStatUpdate & Request.Form("selOrderStat")
sqlOrderStatUpdate = sqlOrderStatUpdate & "', CCResponseReason = '"
sqlOrderStatUpdate = sqlOrderStatUpdate & Request.Form("txtStatusDesc")
sqlOrderStatUpdate = sqlOrderStatUpdate & "' WHERE ORDERID="
sqlOrderStatUpdate = sqlOrderStatUpdate & Request("txtOrderID")
sqlOrderStatUpdate = sqlOrderStatUpdate & ";"
ON ERROR RESUME NEXT
dbc.execute(sqlOrderStatUpdate)
IF ERR.number <> 0 THEN
vUpdMsg = Err.Description
ELSE
vUpdMsg = "Updated Successfully"
vOrderStatus = Request.Form("selOrderStat")
vOrderStatusReason = Request.Form("txtStatusDesc")
END IF
END IF
Dim rsOrderStat, sqlOrderStat
Set rsOrderStat = Server.CreateObject ("ADODB.Recordset")
sqlOrderStat = "SELECT * FROM ORDERSTATUS WHERE ORDERSTATUSINDICATOR = 'Y';"
rsOrderStat.Open sqlOrderStat, dbc, adOpenForwardOnly,adLockReadOnly
IF NOT rsOrderStat.EOF THEN
While Not rsOrderStat.EOF
IF rsOrderStat("ORDERSTATUSCODE")=vOrderStatus THEN
Response.Write("<OPTION VALUE=" & rsOrderStat("ORDERSTATUSCODE") &
" SELECTED >" & rsOrderStat("ORDERSTATUSNAME") )
ELSE
Response.Write("<OPTION VALUE=" & rsOrderStat("ORDERSTATUSCODE") &
">" & rsOrderStat("ORDERSTATUSNAME") )
END IF
rsOrderStat.MoveNext
WEND
rsOrderStat.Close
ELSE
Response.Write("<OPTION VALUE=''>None Found")
END IF
%>
</select></td>
</tr>
<tr>
<td align=left nowrap>Status Description: </td>
<td colspan=3 align=right> <input name="txtStatusDesc"
type=TEXT value="<%=vOrderStatusReason%>" size=50 maxlength="50"></td>
</tr>
<tr>
<td align=right colspan=4><font
color=GREEN><b><%=vUpdMsg%></b></font> </td>
</tr>
<tr>
<td align=right nowrap> </td>
<td colspan=3 align=right> <input type=SUBMIT value="Update"
name=btnSubmit>
<input type=RESET value="Reset" name=btnReset></td>
</tr>
</form>
<tr>
<td colspan=4><hr width=100% size=1 noshade color=silver></td>
</tr>
<tr bgcolor=Silver>
<td colspan=4><b>Questions, Comments, Additional Instructions (Customers
See These):</b></td>
</tr>
<tr>
<td colspan=4><hr width=100% size=1 noshade color=silver></td>
</tr>
<form method=POST
action="order_report.asp?mode=Comment&txtOrderID=<%=Request("txtOrderID")%>">
<tr>
<td colspan=4 align="center" valign="middle"> <%
dim rsOrderComment, sqlOrderComment, vOrderComment, vCommentMsg
if Request.QueryString("txtOrderID") <> "" and
Request.QueryString("mode") = "Comment" then
sqlOrderComment = "UPDATE Orders SET OrderComment = '" &
Request.Form("OrderComment") & "' WHERE OrderID = " &
Request.QueryString("txtOrderID") & ";"
ON ERROR RESUME NEXT
dbc.execute(sqlOrderComment)
IF ERR.number <> 0 THEN
vCommentMsg = Err.Description
ELSE
vCommentMsg = "Updated Successfully"
END IF
END IF
Set rsOrderComment = Server.CreateObject ("ADODB.Recordset")
sqlOrderComment = "SELECT * FROM Orders WHERE OrderID = " &
Request.QueryString("txtOrderID") & ";"
rsOrderComment.Open sqlOrderComment, dbc, adOpenForwardOnly, adLockReadOnly
vOrderComment = rsOrderComment("OrderComment")
%> <textarea name="OrderComment" cols="50" rows="10"><%=
vOrderComment %></textarea>
<% rsOrderComment.Close %> </td>
</tr>
<tr align="center">
<td colspan=4><font color=GREEN><b><%=vCommentMsg%></b></font> </td>
</tr>
<tr align="center">
<td colspan=4> <input type=SUBMIT value="Update" name=btnSubmit>
<input type=RESET value="Reset" name=btnReset></td>
</tr>
</form>
<tr>
<td colspan=4> </td>
</tr>
<tr bgcolor=Silver>
<td colspan=4><b>Administrative Comments (Customers Do Not See
These):</b></td>
</tr>
<tr>
<td colspan=4><hr width=100% size=1 noshade color=silver></td>
</tr>
<form method=POST
action="order_report.asp?mode=note&txtOrderID=<%=Request("txtOrderID")%>">
<tr>
<td colspan=4 align="center" valign="middle"> <%
dim rsOrderNote, sqlOrderNote, vOrderNote, vNoteMsg
if Request.QueryString("txtOrderID") <> "" and
Request.QueryString("mode") = "note" then
sqlOrderNote = "UPDATE Orders SET OrderNote = '" &
Request.Form("OrderNote") & "' WHERE OrderID = " &
Request.QueryString("txtOrderID") & ";"
ON ERROR RESUME NEXT
dbc.execute(sqlOrderNote)
IF ERR.number <> 0 THEN
vNoteMsg = Err.Description
ELSE
vNoteMsg = "Updated Successfully"
END IF
END IF
Set rsOrderNote = Server.CreateObject ("ADODB.Recordset")
sqlOrderNote = "SELECT * FROM Orders WHERE OrderID = " &
Request.QueryString("txtOrderID") & ";"
rsOrderNote.Open sqlOrderNote, dbc, adOpenForwardOnly, adLockReadOnly
vOrderNote = rsOrderNote("OrderNote")
%> <textarea name="OrderNote" cols="50" rows="10"><%= vOrderNote %></textarea>
<% rsOrderNote.Close %> </td>
</tr>
<tr align="center">
<td colspan=4><font color=GREEN><b><%=vNoteMsg%></b></font> </td>
</tr>
<tr align="center">
<td colspan=4> <input type=SUBMIT value="Update" name=btnSubmit>
<input type=RESET value="Reset" name=btnReset></td>
</tr>
<tr></tr>
</form>
</table>
</td>
</tr>
<%=ReplaceOut(UCase(rsOrder("ShipName")))%><br>
<br>
<%
ELSE
'WE DID NOT FIND ANYTHING
%>
<tr>
<td colspan=2>
<font color=red>
No Records Found.
</font>
</td>
</tr>
<%END IF%> |