S
shank
I've been using the below connect string and cart insert code for years on a
Windows 2003 Server and SQL Standard. I have now moved to Windows 2008 and
SQL Express and it causes an error:
Line: connOrders.Open(SQLconn) <-- Login failed for user 'sth'
The connect string works fine on all pages that just select data. This page
causes an error.
Is this because I'm now on SQL Express?
SQLconn.open <-- logs me in
connOrders.Open(SQLconn) <-- Login failed for user 'sth'
<%
'REMOTE CONNECT STRING
Set SQLconn = Server.CreateObject("ADODB.Connection")
SQLconn.Provider = "sqloledb"
SQLconn.Properties("Data Source").Value = "(local)\sqlexpress"
SQLconn.Properties("Network Library").Value = "dbmssocn"
SQLconn.Properties("Initial Catalog").Value = "sth"
SQLconn.Properties("User ID").Value = "sth"
SQLconn.Properties("Password").Value = "password"
SQLconn.open
%>
<%
Set connOrders = Server.CreateObject("ADODB.Connection")
connOrders.Open(SQLconn)
Set connOrderDetails = Server.CreateObject("ADODB.Connection")
connOrderDetails.Open(SQLconn)
ordersColNames =
Array("OrderID","Email","FirstName","LastName","StreetNumber","StreetName","Building","Region","City","Statte","Country","PostalCode","AreaCode","RegionCode","PhoneNumber","PriceSubTotal","Discount","Total","Comments","","")
ordersDBFieldsTypes = Array(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,0,0,1)
ordersBindingTypes =
Array("LITERAL","LITERAL","LITERAL","LITERAL","LITERAL","LITERAL","LITERAL","LITERAL","LITERAL","LITERAL","LITERAL","LITERAL","LITERAL","LITERAL","LITERAL","LITERAL","LITERAL","LITERAL","FORM","","")
ordersBindingValues =
Array(UCII.OrderID,rsUserInfo.Fields.Item("Email").Value,rsUserInfo.Fields.Item("FirstName").Value,rsUserInfo.Fields.Item("LastName").Value,rsUserInfo.Fields.Item("StreetNumber").Value,rsUserInfo.Fields.Item("StreetName").Value,rsUserInfo.Fields.Item("Building").Value,rsUserInfo.Fields.Item("Region").Value,rsUserInfo.Fields.Item("City").Value,rsUserInfo.Fields.Item("Statte").Value,rsUserInfo.Fields.Item("Country").Value,rsUserInfo.Fields.Item("PostalCode").Value,rsUserInfo.Fields.Item("AreaCode").Value,rsUserInfo.Fields.Item("RegionCode").Value,rsUserInfo.Fields.Item("PhoneNumber").Value,UCII.GetColumnTotal("Total"),UCII.DiscountOrderLevel,UCII.GetGrandTotal(),"Comments","","")
orderDetailsColNames =
Array("Active","LeadVoc","SerialNo","FileNam","Qty","Price","Artist","Title","Media","")
orderDetailsBindingTypes = Array(0,0,1,0,1,1,0,0,0,0)
retVal = UCII.SaveCart(true,true,connOrders,connOrderDetails,_
"sthOrders","sthOrderDetails",_
"OrderID",UCII.OrderID,false,_
ordersColNames,ordersDBFieldsTypes,_
ordersBindingTypes,ordersBindingValues,_
orderDetailsColNames,orderDetailsBindingTypes)
connOrders.Close
Set connOrders = Nothing
connOrderDetails.Close
Set connOrderDetails = Nothing
If retVal <> 0 Then
redirectToPage = "er.asp?er=4"
If redirectToPage <> "" Then
Response.Redirect(redirectToPage)
End If
Response.End
End If
redirectToPage = "pay.asp"
If redirectToPage <> "" Then
Response.Redirect(redirectToPage)
End If
%>
thanks!
Windows 2003 Server and SQL Standard. I have now moved to Windows 2008 and
SQL Express and it causes an error:
Line: connOrders.Open(SQLconn) <-- Login failed for user 'sth'
The connect string works fine on all pages that just select data. This page
causes an error.
Is this because I'm now on SQL Express?
SQLconn.open <-- logs me in
connOrders.Open(SQLconn) <-- Login failed for user 'sth'
<%
'REMOTE CONNECT STRING
Set SQLconn = Server.CreateObject("ADODB.Connection")
SQLconn.Provider = "sqloledb"
SQLconn.Properties("Data Source").Value = "(local)\sqlexpress"
SQLconn.Properties("Network Library").Value = "dbmssocn"
SQLconn.Properties("Initial Catalog").Value = "sth"
SQLconn.Properties("User ID").Value = "sth"
SQLconn.Properties("Password").Value = "password"
SQLconn.open
%>
<%
Set connOrders = Server.CreateObject("ADODB.Connection")
connOrders.Open(SQLconn)
Set connOrderDetails = Server.CreateObject("ADODB.Connection")
connOrderDetails.Open(SQLconn)
ordersColNames =
Array("OrderID","Email","FirstName","LastName","StreetNumber","StreetName","Building","Region","City","Statte","Country","PostalCode","AreaCode","RegionCode","PhoneNumber","PriceSubTotal","Discount","Total","Comments","","")
ordersDBFieldsTypes = Array(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,0,0,1)
ordersBindingTypes =
Array("LITERAL","LITERAL","LITERAL","LITERAL","LITERAL","LITERAL","LITERAL","LITERAL","LITERAL","LITERAL","LITERAL","LITERAL","LITERAL","LITERAL","LITERAL","LITERAL","LITERAL","LITERAL","FORM","","")
ordersBindingValues =
Array(UCII.OrderID,rsUserInfo.Fields.Item("Email").Value,rsUserInfo.Fields.Item("FirstName").Value,rsUserInfo.Fields.Item("LastName").Value,rsUserInfo.Fields.Item("StreetNumber").Value,rsUserInfo.Fields.Item("StreetName").Value,rsUserInfo.Fields.Item("Building").Value,rsUserInfo.Fields.Item("Region").Value,rsUserInfo.Fields.Item("City").Value,rsUserInfo.Fields.Item("Statte").Value,rsUserInfo.Fields.Item("Country").Value,rsUserInfo.Fields.Item("PostalCode").Value,rsUserInfo.Fields.Item("AreaCode").Value,rsUserInfo.Fields.Item("RegionCode").Value,rsUserInfo.Fields.Item("PhoneNumber").Value,UCII.GetColumnTotal("Total"),UCII.DiscountOrderLevel,UCII.GetGrandTotal(),"Comments","","")
orderDetailsColNames =
Array("Active","LeadVoc","SerialNo","FileNam","Qty","Price","Artist","Title","Media","")
orderDetailsBindingTypes = Array(0,0,1,0,1,1,0,0,0,0)
retVal = UCII.SaveCart(true,true,connOrders,connOrderDetails,_
"sthOrders","sthOrderDetails",_
"OrderID",UCII.OrderID,false,_
ordersColNames,ordersDBFieldsTypes,_
ordersBindingTypes,ordersBindingValues,_
orderDetailsColNames,orderDetailsBindingTypes)
connOrders.Close
Set connOrders = Nothing
connOrderDetails.Close
Set connOrderDetails = Nothing
If retVal <> 0 Then
redirectToPage = "er.asp?er=4"
If redirectToPage <> "" Then
Response.Redirect(redirectToPage)
End If
Response.End
End If
redirectToPage = "pay.asp"
If redirectToPage <> "" Then
Response.Redirect(redirectToPage)
End If
%>
thanks!