Login failed

Discussion in 'ASP General' started by shank, Jul 11, 2009.

  1. shank

    shank Guest

    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!
     
    shank, Jul 11, 2009
    #1
    1. Advertising

  2. shank

    news Guest

    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
     
    news, Jul 11, 2009
    #2
    1. Advertising

  3. shank

    shank Guest

    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" <> wrote in message
    news:1ad40$4a582754$6210077d$...
    > 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
    >
     
    shank, Jul 11, 2009
    #3
  4. 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
     
    Daniel Crichton, Jul 13, 2009
    #4
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. =?Utf-8?B?Z2FyaWJhbGRp?=
    Replies:
    2
    Views:
    4,945
    =?Utf-8?B?Z2FyaWJhbGRp?=
    Feb 25, 2005
  2. sck10
    Replies:
    6
    Views:
    932
    sck10
    Sep 1, 2006
  3. Homer
    Replies:
    3
    Views:
    7,999
    Alexey Smirnov
    Sep 25, 2007
  4. Tony Johansson
    Replies:
    3
    Views:
    16,357
    Patrice
    Jan 2, 2010
  5. Max
    Replies:
    0
    Views:
    407
Loading...

Share This Page