We have our own default.asp page which has the login page for logging into
the database/system (which I am not sure) and then brings up the shopping
cart page. This page does not come up in the new site server commerce edition
which I had setup. I have installed the siteserver according to instructions
given and also have setup the ODBC stuff but this looks more like the asp
page is not talking to the database through ODBC. I did a database migration
from the production SQL Server 7.0 to Development SQL Server 7.0 using DST
method in SQL Server. But am not sure why it does not get the page using
the same login id and password which is being used in the production server.


What could have gone wrong?? Your input on this would be appreciated. I
have pasted the asp code except removing the company name in some places.
I
am not sure whether its a problem with some permissions in the SQL Server
database side or ODBC connectivity which is not verifying the userid and
password from the database and fetching the relevant page.


The asp code is given below but the same asp code is working fine in the
production server. I am not finding any faults with the asp page but it looks
more kind of connectivity issue to the database and not being able to get
the information from the database.

<%

function getUserGUID()

SET User = Server.CreateObject("Membership.UserObjects")

mscsShopperID = User.Get("guid") 'user.guid is a different guid: don't use!

getUserGUID = mscsShopperID

End Function

function UtilGetShopper()')
On Error Resume Next

Set shopper = Server.CreateObject("Commerce.Dictionary")
SET User = Server.CreateObject("Membership.UserObjects")

shopper.First_Name = User.givenname
shopper.Last_Name = User.sn
shopper.Company = User.company
shopper.Address_1 = User.iacAddress1
shopper.Address_2 = User.iacAddress2
shopper.City = User.l
shopper.State = User.st
shopper.Zip_Code = User.postalcode
shopper.Country = User.c
shopper.Phone = User.telephonenumber
shopper.Fax = User.facsimiletelephonenumber
shopper.Email = User.mail

mscsShopperID = User.Get("guid") 'user.guid is a different guid: don't use!
shopper.shopper_id=mscsShopperID


'Response.Write "GUID=" & mscsShopperID & "<br>"
'Response.Write "FNAME=" & shopper.First_Name & "<br>"
'Response.Write "SHOPPER_ID=" & shopper.shopper_id & "<BR>"
Set UtilGetShopper = shopper

end function


function UtilGetOrderFormStorage()
Set orderFormStorage = Server.CreateObject("Commerce.DBStorage")
Call orderFormStorage.InitStorage(MSCSSite.DefaultConnectionString,
"hms_basket", "shopper_id", "Commerce.OrderForm", "marshalled_basket",
"date_changed")

Set UtilGetOrderFormStorage = orderFormStorage
end function

function UtilGetOrderForm(byRef orderFormStorage, byRef created)
mscsShopperID = getUserGUID()

created = 0
On Error Resume Next
Set orderForm = orderFormStorage.GetData(null, mscsShopperID)
On Error Goto 0
if IsEmpty(orderForm) then
set orderForm = Server.CreateObject("Commerce.OrderForm")
orderForm.shopper_id = mscsShopperID
created = 1
end if
set UtilGetOrderForm = orderForm
end function

function UtilPutOrderForm(byRef orderFormStorage, byRef orderForm, byRef
created)
if created = 0 then
Call orderFormStorage.CommitData(NULL, orderForm)
else

REM Create a Storage object for the shopper information
'Set mscsShopperStorage = UtilGetShopperStorage()

REM Get the shopper from the shopper storage
set mscsShopper = UtilGetShopper () '(mscsShopperStorage)

orderForm.shopper_id=mscsShopperID
REM If the shopper didn't exist, then we shouldn't save the order form
if Not IsNull(mscsShopper) then
Call orderFormStorage.InsertData(NULL, orderForm)
end if

end if
end function

function UtilGetReceiptStorage()
REM Create a storage object for receipts
Set receiptStorage = Server.CreateObject("Commerce.DBStorage")
Call receiptStorage.InitStorage(MSCSSite.DefaultConnectionString,
"hms_receipt", "order_id", "Commerce.OrderForm" , "marshalled_receipt",
"date_entered")
receiptStorage.Mapping.Value("_total_total") = "total"
receiptStorage.Mapping.Value("cc_name") = "name_on_cc"
receiptStorage.Mapping.Value("_cc_number") = "cc_no"
receiptStorage.Mapping.Value("_payment_auth_code") = "cc_auth_no"
receiptStorage.Mapping.Value("_tax_total") = "tax_amt"
receiptStorage.Mapping.Value("_shipping_total") = "ship_amt"
receiptStorage.Mapping.Value("bill_to_company") = "bill_to_co_name"
receiptStorage.Mapping.Value("bill_to_name") = "bill_to_attn"
'receiptStorage.Mapping.Value("bill_to_street") = "bill_to_add1"
receiptStorage.Mapping.Value("bill_to_address1") = "bill_to_add1"
receiptStorage.Mapping.Value("bill_to_address2") = "bill_to_add2"

receiptStorage.Mapping.Value("ship_to_company") = "ship_to_co_name"
receiptStorage.Mapping.Value("ship_to_name") = "ship_to_attn"
' receiptStorage.Mapping.Value("ship_to_street") = "ship_to_add1"
receiptStorage.Mapping.Value("ship_to_address1") = "ship_to_add1"
receiptStorage.Mapping.Value("ship_to_address2") = "ship_to_add2"
receiptStorage.Mapping.Value("so_number") = "so_no"
receiptStorage.Mapping.Value("ship_id") = "ship_id"

Set UtilGetReceiptStorage = receiptStorage
end function

function UtilGetPipeContext()
Set pipeContext = Server.CreateObject("Commerce.Dictionary")
Set pipeContext("MessageManager") = MSCSMessageManager
Set pipeContext("DataFunctions") = MSCSDataFunctions
Set pipeContext("QueryMap") = MSCSQueryMap
Set pipeContext("ConnectionStringMap") = MSCSSite.ConnectionStringMap
pipeContext("SiteName") = displayName
pipeContext("DefaultConnectionString") =
MSCSSite.DefaultConnectionString
pipeContext("Language") = "USA"

Set UtilGetPipeContext = pipeContext
end function

function UtilRunPipe(file, orderForm, pipeContext)
Set pipeline = Server.CreateObject("Commerce.MtsPipeline")

Call pipeline.LoadPipe(Request.ServerVariables("APPL_PHYSICAL_PATH")
&
"\config\" & file)

REM Call
pipeline.SetLogFile(Request.ServerVariables("APPL_PHYSICAL_PATH") &
"config\pipeline.log")

'Response.Write("ERR=" & Err.number & "<BR>")
'Response.Write("ERRdesc=" & Err.description & "<BR>")

'Set orderFormItems = orderForm.Items
'nOrderFormItems = orderFormItems.Count

'For each item2 in orderFormItems
'Response.Write("product_id >" & item2.product_id & "<BR>")
'Next

'pipeline.setLogFile "C:\inetpub\PipText.txt"
errorLevel = pipeline.Execute(1, orderForm, pipeContext, 0)
'Response.Write("ERR=" & Err.number & "<BR>")
'Response.Write("ERRdesc=" & Err.description & "<BR>")


UtilRunPipe = errorLevel
end function

function UtilRunTxPipe(file, orderForm, pipeContext)
Set pipeline = Server.CreateObject("Commerce.MtsTxPipeline")

Call pipeline.LoadPipe(Request.ServerVariables("APPL_PHYSICAL_PATH")
&
"config\" & file)

'Call pipeline.SetLogFile(Request.ServerVariables("APPL_PHYSICAL_PATH")
& "config\txpipeline.log")

errorLevel = pipeline.Execute(1, orderForm, pipeContext, 0)

UtilRunTxPipe = errorLevel
end function

function UtilRunPlan()

REM Create a Storage object for the shopper information
'Set mscsShopperStorage = UtilGetShopperStorage()

REM Get the shopper from the shopper storage
set mscsShopper = UtilGetShopper()'(mscsShopperStorage)

REM Create a storage object for the order forms
Set mscsOrderFormStorage = UtilGetOrderFormStorage()

REM Get the orderform
Set mscsOrderForm = UtilGetOrderForm(mscsOrderFormStorage, created)

REM Get the basic pipe context
Set mscsPipeContext = UtilGetPipeContext()

if Not IsNull(mscsShopper) then
Set mscsPipeContext.Shopper = mscsShopper
end if

Set orderFormItems = mscsOrderForm.Items


REM Create and run the pipe
errorLevel = UtilRunPipe("plan.pcf", mscsOrderForm, mscsPipeContext)

REM Save the order form in case running the pipe made changes to the
order form
if created then

REM Only insert if a real shopper....note that for bad shoppers we
return the
REM order form but it is never saved to the database
if Not IsNull(mscsShopper) then
Call mscsOrderFormStorage.InsertData(null, mscsOrderForm)
end if

else
REM force values so taxware does not crash.

Call mscsOrderFormStorage.CommitData(null, mscsOrderForm)

end if


Set UtilRunPlan = mscsOrderForm
end function
%>