ADO DB Connection to SQL Server (ASP.Net)

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • kvrdev1

    ADO DB Connection to SQL Server (ASP.Net)

    I'm attempting to connect to a SQL Server DB, using ADO, from my new ASP.NET
    web application. I can use the same connect string from within a VB.Net app
    (windows app) just fine, but I cannot do it from within my web app... Here
    is the error I am receiving:

    Login failed for user '(null)'. Reason: Not associated with a trusted SQL
    Server connection.

    I am using windows authentication, which works just fine within my windows
    app - I'm using the web server on my local machine... Here is my connect
    string and code associated with this:

    sDatabaseType = "SQL Server"
    sServerName = "MyServer"
    sDatabaseName = "MyDatabase"sCo nnectString = "DRIVER={SQ L
    Server};SERVER= " & sServerName & ";Trusted_conne ction=yes;DATAB ASE=" &
    sDatabaseName & ";"
    gdcDataConnecti on = New ADODB.Connectio n
    gdcDataConnecti on.Open(sConnec tString)

    I would appreciate any help that you can provide!!!!!
    Thank you!-Valerie
  • Cor Ligthert

    #2
    Re: ADO DB Connection to SQL Server (ASP.Net)

    Krdev.

    This problem is almost forever that the user for a webserver application is
    the ASPNET or the IIS user. And need therefore the rights on the database
    that you use confirm that.

    I hope this helps,

    Cor


    Comment

    • .Net Believer

      #3
      RE: ADO DB Connection to SQL Server (ASP.Net)

      ASP .Net application is runnig under "ASPNET" account for IIS 5 and Network
      Services in IIS 6. While Windows appliations are running under the current
      user account.
      So what you need is add access persissions on the server, database, table,
      views, stored prcedures for the ASPNET or the Network Services account

      I hope this helps

      "kvrdev1" wrote:
      [color=blue]
      > I'm attempting to connect to a SQL Server DB, using ADO, from my new ASP.NET
      > web application. I can use the same connect string from within a VB.Net app
      > (windows app) just fine, but I cannot do it from within my web app... Here
      > is the error I am receiving:
      >
      > Login failed for user '(null)'. Reason: Not associated with a trusted SQL
      > Server connection.
      >
      > I am using windows authentication, which works just fine within my windows
      > app - I'm using the web server on my local machine... Here is my connect
      > string and code associated with this:
      >
      > sDatabaseType = "SQL Server"
      > sServerName = "MyServer"
      > sDatabaseName = "MyDatabase"sCo nnectString = "DRIVER={SQ L
      > Server};SERVER= " & sServerName & ";Trusted_conne ction=yes;DATAB ASE=" &
      > sDatabaseName & ";"
      > gdcDataConnecti on = New ADODB.Connectio n
      > gdcDataConnecti on.Open(sConnec tString)
      >
      > I would appreciate any help that you can provide!!!!!
      > Thank you!-Valerie[/color]

      Comment

      Working...