Login failed

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!
 
N

news

Hello "shank"
I had the same issue as you, and this is what i ended up doing to resolve
after 4 installs of the SQL Express (I now hate)
I have (SQL Server 2005 180 day Trial)

Hope this will assist you, as it worked great for me.
==============
I installed the Real SQL Server 180 Trial (That is 6months, I am not really
complaining
Considering that once the site gets moved to "In-House" I will have to
purchase
SQL Server any way)

So.
During the installation I made sure to choose both
SQL Server and Windows Authentication Mode
Which gave me a place to type in the password for the "sa" account.
So I did that.

Once installed, I ran my test script and Wa-La
It worked like a champ.
Connected to the database and gave me my UserID and name.

So.
For future refrence, as I am sure this is the case with SQL Express as well.
Make sure that when you install SQL Server Regular or Express you choose
[SQL Server and Windows Authentication Mode]
And give your "SA" account a password.

Make sure that SQL Browser is Started as well.
And Local and remote connections.

==============

Wayne
 
S

shank

Unfortunately, I'm online with a shared server arrangement. I don't have
admin rights, but I will ask how thwy have it setup.
thanks
 
D

Daniel Crichton

shank wrote on Fri, 10 Jul 2009 21:52:11 -0400:
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.

So what's different about the connection string between pages that only
select data and those that do more? There must be a difference if that truly
is the line that is causing the error, because at that point you are only
opening a connection and not actually doing anything to the data.
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 %>

In your pages that only select, what is the difference in these settings?

If there is no difference, then that leaves the IIS environment being used.
Is the ASP page you have problems with running under a different user
context? For instance, is it running in a different Application Pool than
the pages that do not error?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,020
Latest member
GenesisGai

Latest Threads

Top