Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP General > Login failed

Reply
Thread Tools

Login failed

 
 
shank
Guest
Posts: n/a
 
      07-11-2009
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","St reetNumber","StreetName","Building","Region","City ","Statte","Country","PostalCode","AreaCode","Regi onCode","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","LIT ERAL","LITERAL","LITERAL","LITERAL","LITERAL","LIT ERAL","LITERAL","LITERAL","LITERAL","LITERAL","LIT ERAL","LITERAL","LITERAL","LITERAL","FORM","","")
ordersBindingValues =
Array(UCII.OrderID,rsUserInfo.Fields.Item("Email") .Value,rsUserInfo.Fields.Item("FirstName").Value,r sUserInfo.Fields.Item("LastName").Value,rsUserInfo .Fields.Item("StreetNumber").Value,rsUserInfo.Fiel ds.Item("StreetName").Value,rsUserInfo.Fields.Item ("Building").Value,rsUserInfo.Fields.Item("Region" ).Value,rsUserInfo.Fields.Item("City").Value,rsUse rInfo.Fields.Item("Statte").Value,rsUserInfo.Field s.Item("Country").Value,rsUserInfo.Fields.Item("Po stalCode").Value,rsUserInfo.Fields.Item("AreaCode" ).Value,rsUserInfo.Fields.Item("RegionCode").Value ,rsUserInfo.Fields.Item("PhoneNumber").Value,UCII. GetColumnTotal("Total"),UCII.DiscountOrderLevel,UC II.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,connOrderDetail s,_
"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!


 
Reply With Quote
 
 
 
 
news
Guest
Posts: n/a
 
      07-11-2009
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


 
Reply With Quote
 
 
 
 
shank
Guest
Posts: n/a
 
      07-11-2009
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

"news" <(E-Mail Removed)> wrote in message
news:1ad40$4a582754$6210077d$(E-Mail Removed)...
> 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
>



 
Reply With Quote
 
Daniel Crichton
Guest
Posts: n/a
 
      07-13-2009
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?

--
Dan


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Cannot open user default database. Login failed. Login failed for user 'HEMPC\ASPNET' Tony Johansson ASP .Net 3 01-02-2010 04:09 PM
Cannot open database requested in login 'HumanResources'. Login failed for user 'companyDomain\BOSIIS$'. Homer ASP .Net 3 09-25-2007 07:45 PM
Cannot open database requested in login "DBName" Login failed for Max ASP .Net Security 0 12-20-2005 11:09 PM
Login Failed: Error 18456: Unable to login to run SP on local serv =?Utf-8?B?Z2FyaWJhbGRp?= ASP .Net 2 02-25-2005 09:17 PM
QueryInterface for interface Excel._Application failed / QueryInterface for interface Word._Application failed SOLUTION Wildepiet ASP .Net 0 06-14-2004 07:28 AM



Advertisments