📄 custtblinsert.inc
字号:
<%
on error resume next
'they have no record in customer table... insert row
sSQL="INSERT INTO tbl_Customer ("
sSQL=sSQL & "CustomerID"
if len(s_CompanyName)>0 then sSQL=sSQL & ",s_CompanyName"
sSQL=sSQL & ",s_FirstName"
sSQL=sSQL & ",s_LastName"
sSQL=sSQL & ",s_Phone"
if len(s_Address)>0 then sSQL=sSQL & ",s_Address"
if len(s_Address2)>0 then sSQL=sSQL & ",s_Address2"
if len(s_City)>0 then sSQL=sSQL & ",s_City"
if len(s_State)>0 then sSQL=sSQL & ",s_State"
if len(s_Zip)>0 then sSQL=sSQL & ",s_Zip"
if len(s_Country)>0 then sSQL=sSQL & ",s_Country"
if len(s_Email)>0 then sSQL=sSQL & ",s_Email"
sSQL=sSQL & ",y_TaxExempt"
sSQL=sSQL & ",PrefShipAddressID"
sSQL=sSQL & ") Values ("
sSQL=sSQL & CustomerID
if len(s_CompanyName)>0 then sSQL=sSQL & ",'" & s_CompanyName & "'"
sSQL=sSQL & ",'" & s_FirstName & "'"
sSQL=sSQL & ",'" & s_LastName & "'"
sSQL=sSQL & ",'" & s_Phone & "'"
if len(s_Address)>0 then sSQL=sSQL & ",'" & s_Address & "'"
if len(s_Address2)>0 then sSQL=sSQL & ",'" & s_Address2 & "'"
if len(s_City)>0 then sSQL=sSQL & ",'" & s_City & "'"
if len(s_State)>0 then sSQL=sSQL & ",'" & s_State & "'"
if len(s_Zip)>0 then sSQL=sSQL & ",'" & s_Zip & "'"
if len(s_Country)>0 then sSQL=sSQL & ",'" & s_Country & "'"
if len(s_Email)>0 then sSQL=sSQL & ",'" & s_Email & "'"
sSQL=sSQL & "," & session("ysnTaxExempt")
sSQL=sSQL & ",1" & ")"
'response.write sSQL & "<BR>"
conn.execute(sSQL)
if err.number<>0 then
session("err_desc")="Error in custTblInsert.inc_a<BR>" & err.description
conn.close
set conn=nothing
response.redirect "error_report.asp"
end if
'========================================
'fill row in tbl_CustomerShipTo table now
'========================================
sSQL="INSERT INTO tbl_CustomerShipTo ("
sSQL=sSQL & "CustomerID"
sSQL=sSQL & ",ShipID"
if len(s_ShippingFirstName)>0 then sSQL=sSQL & ",s_ShipToFirstName"
if len(s_ShippingLastName)>0 then sSQL=sSQL & ",s_ShipToLastName"
if len(s_ShippingAddress)>0 then sSQL=sSQL & ",s_ShipToAddress"
if len(s_ShippingAddress2)>0 then sSQL=sSQL & ",s_ShipToAddress2"
if len(s_ShippingCity)>0 then sSQL=sSQL & ",s_ShipToCity"
if len(s_ShippingState)>0 then sSQL=sSQL & ",s_ShipToState"
if len(s_ShippingZip)>0 then sSQL=sSQL & ",s_ShipToZip"
if len(s_ShippingCountry)>0 then sSQL=sSQL & ",s_ShipToCountry"
sSQL=sSQL & ",ShipViaID"
sSQL=sSQL & ") Values ("
sSQL=sSQL & CustomerID
sSQL=sSQL & ",1"
if len(s_ShippingFirstName)>0 then sSQL=sSQL & ",'" & s_ShippingFirstName & "'"
if len(s_ShippingLastName)>0 then sSQL=sSQL & ",'" & s_ShippingLastName & "'"
if len(s_ShippingAddress)>0 then sSQL=sSQL & ",'" & s_ShippingAddress & "'"
if len(s_ShippingAddress2)>0 then sSQL=sSQL & ",'" & s_ShippingAddress2 & "'"
if len(s_ShippingCity)>0 then sSQL=sSQL & ",'" & s_ShippingCity & "'"
if len(s_ShippingState)>0 then sSQL=sSQL & ",'" & s_ShippingState & "'"
if len(s_ShippingZip)>0 then sSQL=sSQL & ",'" & s_ShippingZip & "'"
if len(s_ShippingCountry)>0 then sSQL=sSQL & ",'" & s_ShippingCountry & "'"
sSQL=sSQL & "," & ShipViaID
sSQL=sSQL & ")"
'response.write sSQL & "<BR>"
conn.execute(sSQL)
if err.number<>0 then
session("err_desc")="Error in custTblInsert.inc_a<BR>" & err.description
conn.close
set conn=nothing
response.redirect "error_report.asp"
end if
conn.close
set conn=nothing
%>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -