Hi, thanks for helping. Here's the code:
sqlAdd = "INSERT INTO orders(ocustomerid,odate,orderamount,ocardtype,ocardno,"
sqlAdd = sqlAdd & "ocardname,ocardexpires,ocardaddress"
If Not Request.Form("shipaddress")="" then
sqlAdd = sqlAdd & ",oshipaddress,oshiptown,oshipzip,oshipstate,oshipcountry"
End If
sqlAdd = sqlAdd & ") VALUES("
sqlAdd = sqlAdd & Session("customerid") & ",'" & MyConvert(Date) & "'," & intTotal
sqlAdd = sqlAdd & ",'" & Request.Form("paymentm") & "','" & Request.Form("cardno") & "'"
sqlAdd = sqlAdd & ",'" & TwoSingleQ(Request.Form("cardname")) & "','" & expDate & "'"
sqlAdd = sqlAdd & ",'" & TwoSingleQ(Request.Form("cardaddress")) & " '"
If Not Request.Form("shipaddress")="" then
sqlAdd = sqlAdd & ",'" & TwoSingleQ(Request.Form("shipaddress")) & "'"
sqlAdd = sqlAdd & ",'" & TwoSingleQ(Request.Form("shiptown")) & " '"
sqlAdd = sqlAdd & ",'" & Request.Form("shipzip") & " '"
sqlAdd = sqlAdd & ",'" & Request.Form("shipstate") & " '"
sqlAdd = sqlAdd & ",'" & Request.Form("shipcountry") & " '"
End If
sqlAdd = sqlAdd & ")"
Function MyConvert(dtDate)
Dim strAns
strAns=Day(dtDate)&"/"&Month(dtDate)&"/"&Year(dtDate)
MyConvert=strAns
End Function
'Response.Write (sqlAdd&"<BR>")
'Response.END
dbc.execute sqlAdd, intAffected
-----------------------------------------------------------
INSERT INTO orders(ocustomerid,odate,orderamount,ocardtype,ocardno,ocardname,ocardexpires,ocardaddress) VALUES(100019,'3/6/2004',356.95,'Visa','4562789565415411','Tom Johnson','28/12/2006',' ')