%
' Option Explicit
response.buffer=TRUE
debugprint=false
' process address cookies
bill_name=request.cookies("billadr")("bill_name")
bill_adr1=request.cookies("billadr")("bill_adr1")
bill_adr2=request.cookies("billadr")("bill_adr2")
bill_adr3=request.cookies("billadr")("bill_adr3")
bill_city=request.cookies("billadr")("bill_city")
bill_st=request.cookies("billadr")("bill_st")
bill_city=request.cookies("billadr")("bill_city")
bill_zip=request.cookies("billadr")("bill_zip")
bill_ac=request.cookies("billadr")("bill_ac")
bill_exch=request.cookies("billadr")("bill_exch")
bill_num=request.cookies("billadr")("bill_num")
bill_email=request.cookies("billadr")("bill_email")
ship_as_bill=request.cookies("billadr")("ship_as_bill")
ship_name=request.cookies("billadr")("ship_name")
ship_adr1=request.cookies("billadr")("ship_adr1")
ship_adr2=request.cookies("billadr")("ship_adr2")
ship_adr3=request.cookies("billadr")("ship_adr3")
ship_city=request.cookies("billadr")("ship_city")
ship_st=request.cookies("billadr")("ship_st")
ship_city=request.cookies("billadr")("ship_city")
ship_zip=request.cookies("billadr")("ship_zip")
ship_ac=request.cookies("billadr")("ship_ac")
ship_exch=request.cookies("billadr")("ship_exch")
ship_num=request.cookies("billadr")("ship_num")
ship_email=request.cookies("billadr")("ship_email")
if debugprint=TRUE then response.write bill_name&" "&bill_email&"
"&vbcrlf
cs=request.cookies("cartcookie")
if debugprint=TRUE then response.write "cartcookie: "&cs&"
"&vbcrlf
dim csa,csb,csc(30,20)
csa=split(cs,"!") ' ubound(csa) is the count of the cart rows
if debugprint=TRUE then response.write "csa "&ubound(csa)&"
"&vbcrlf
for i=0 to ubound(csa)-1
if debugprint=TRUE then response.write "csa "&i&" "&csa(i)&"
"&vbcrlf
csb=split(csa(i),"|")
if debugprint=TRUE then response.write "csb "&ubound(csb)&"
"&vbcrlf
for j=0 to ubound(csb)
csc(i,j)=csb(j)
if debugprint=TRUE then response.write "csc "&i&" "&j&" "&csc(i,j)&"
"&vbcrlf
next 'j
next 'i
rok_tax=session.contents("rok_tax")
rok_tax=formatnumber(rok_tax,2,-1,0,0)
gt=session.contents("gt")
gt=formatnumber(gt,2,-1,0,0)
gs=session.contents("gs")
gs=formatnumber(gs,2,-1,0,0)
gp=session.contents("gp")
gp=formatnumber(gp,2,-1,0,0)
invoice=session.contents("invoice")
phone=bill_ac&"-"&bill_exch&"-"&bill_num
phonetoship=ship_ac&"-"&ship_exch&"-"&ship_num
address=trim(bill_adr1)
if len(trim(bill_adr2))>0 then ADDRESS=address&", "&trim(bill_adr2)
if len(trim(bill_adr3))>0 then ADDRESS=address&", "&trim(bill_adr3)
address=left(address,60)
addresstoship=trim(ship_adr1)
if len(trim(ship_adr2))>0 then ADDRESStoship=addresstoship&", "&trim(ship_adr2)
if len(trim(ship_adr3))>0 then ADDRESStoship=addresstoship&", "&trim(ship_adr3)
addresstohip=left(addresstoship,60)
''''''''''''''''''''''''''''''
' add cart values to database
Sub SendLn(pMsg)
if debugprint=true then Response.Write pMsg &vbcrlf
End Sub
'---- CursorTypeEnum Values ----
Const adOpenForwardOnly = 0
Const adOpenKeyset = 1
Const adOpenDynamic = 2
Const adOpenStatic = 3
'---- LockTypeEnum Values ----
Const adLockReadOnly = 1
Const adLockPessimistic = 2
Const adLockOptimistic = 3
Const adLockBatchOptimistic = 4
'---- SearchDirectionEnum Values ----
Const adSearchForward = 1
Const adSearchBackward = -1
'---- CommandTypeEnum Values ----
Const adCmdUnknown = &H0008
Const adCmdText = &H0001
Const adCmdTable = &H0002
Const adCmdStoredProc = &H0004
Const adCmdFile = &H0100
Const adCmdTableDirect = &H0200
'---- SeekEnum Values ----
Const adSeekFirstEQ = &H1
Const adSeekLastEQ = &H2
Const adSeekAfterEQ = &H4
Const adSeekAfter = &H8
Const adSeekBeforeEQ = &H10
Const adSeekBefore = &H20
dim strODBC ' Connection string
dim strSQL ' SQL query string
dim dL ' Data connection object
dim rL ' Recordset for query results
dim i ' Counter
' Define a connection string for the database
' The connect string is used to login to the database.
' DSN=DSNJCBRILEY3 is the ODBC data source name and
' PWD=testpassword is the password for the database.
strODBC = "DSN=DSNJCBRILEY3; PWD=testpassword;"
' Define an SQL query
' The query is to retrieve the ID,Name and Description fields
' from a table named Test, and will return the records in
' order of ID.
strSQL = "SELECT * FROM wgmorder ORDER BY ID"
' Create a database connection object
set dL = Server.CreateObject("ADODB.Connection")
' Open the connection to the database
' The OPEN method of the database connection object is used to
' connect to the database as defined by the ODBC connection
' string.
dL.Open strODBC
' Execute the SQL query
' This will pass the SQL query to the database.
'
set rL = Server.CreateObject("ADODB.Recordset")
rL.open "wgmorder", dl, adOpenStatic, adLockOptimistic, adCmdTable
' set rL = dL.Execute(strSQL)
' Check to see if any records were found
' If no records were returned by the query, both the BOF
' (Beginning of File) and EOF (End of File) properties
' of the recordset object will be set to TRUE.
if (rL.EOF = True) and (rL.BOF = True) then
SendLn "
| Table Name: | WGMORDER |
| xx Database record: " & cStr(rL("ID")) + " | yy |
| " & strname & " | " SendLn "" & strvalue & " |
| Total Records: | " + cStr(i) + " |
|
|||||||||||||||||||||||||||
|
|
|||||||||||||||||||||||||||