Forums

This topic is locked

Charon cart

Posted 25 Jun 2002 07:28:09
1
has voted
25 Jun 2002 07:28:09 Vivian Eersels posted:
I have problems with the charon cart:
It DON'T save the cart to the database.

Who can check my code please?

My code:

'
'Insert record into Orders recordset when form is submitted
'and store the unique OrderID
'
CC_OrderAction=Request.ServerVariables("SCRIPT_NAME"
if Request("CC_OrderInsert" <> "" then
TimeKey=GetTimeInMillisec()
rsOrders.AddNew
rsOrders("datum"=TimeKey
For Each fld in rsOrders.Fields
if Len(Request(fld.Name)) > 0 then
fld.Value = Request(fld.Name)
end if
Next
rsOrders.Update
rsOrders.Requery
rsOrders.Filter= "datum='" & TimeKey & "'"
Session("OrderID"=rsOrders("OrderID"
end if
%>
<%
'
'**Save cart to OrderDetails table in Database**
'
if Request("CC_OrderInsert" <> "" then
'Bindingvalues=("ProductID,Quantity,Name,Price,< not saved >,"
UniqueIdValue=Session("OrderID"
UniqueIdColumn="orderID"
CC_RedirectURL="reviewOrder.asp"
sub SaveToDatabase(ODRecordset)
ODRecordset.AddNew
ODRecordset.Fields(UniqueIdColumn)=UniqueIdValue
ODRecordset.Fields("ProductID"=CCcart(CC_ProductID,i)
ODRecordset.Fields("Quantity"=CCcart(CC_Quantity,i)
ODRecordset.Fields("Name"=CCcart(CC_Name,i)
ODRecordset.Fields("Price"=CCcart(CC_Price,i)
rsOrders.Update
end sub
for i=0 to ubound(CCcart,2)
if CCcart(CC_ProductID,i) <> "" then
Call SaveToDatabase(rsOrders)
end if
next
Response.Redirect "reviewOrder.asp"

end if
%>
<%
Dim Repeat1__numRows
Repeat1__numRows = -1
Dim Repeat1__index
Repeat1__index = 0
rsOrders_numRows = rsOrders_numRows + Repeat1__numRows

Reply to this topic