DB Connection

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

    DB Connection

    I'm posting here hopeing some here has delt with a similar problem and
    has a suggestion for a fix.

    If anyone knows the answer to this I’d me greatly appreciative.

    I am not on a domain.

    I have SQL Server sitting on computer A

    Computer A has:
    Windows XP SP2
    SQL Server 2000 SP3a
    SQL Server is set to use Trusted or SQL authorization
    I have added a user X to SQL Server with a password of X

    I am writing an ASP.NET app on Computer B. IIS and Dev on B) I am
    trying to make a connection to SQL on computer A but get the
    error “SQL Server does not exist or access denied”

    Now when I create a small Winforms app as a test, I can use the exact
    same connection string and open a connection to SQL Server just fine.

    So, I’m guessing the problems lies in the security of ASP.NET, but I’m
    not sure what to change to make this work.

    BTW, I can also connect just fine with the same user/pw with Enterprise
    Manger, and Query Analyzer as well as add the connection to Visual
    Studio

    Anyone with any ideas?

    TIA
    B
  • Ignacio Machin \( .NET/ C# MVP \)

    #2
    Re: DB Connection

    Hi,

    post your connection string

    cheerrs,

    --
    Ignacio Machin,
    ignacio.machin AT dot.state.fl.us
    Florida Department Of Transportation



    "Brian W" <noneof@yourbus iness.com> wrote in message
    news:OgFa3VhWFH A.580@TK2MSFTNG P15.phx.gbl...[color=blue]
    > I'm posting here hopeing some here has delt with a similar problem and
    > has a suggestion for a fix.
    >
    > If anyone knows the answer to this I'd me greatly appreciative.
    >
    > I am not on a domain.
    >
    > I have SQL Server sitting on computer A
    >
    > Computer A has:
    > Windows XP SP2
    > SQL Server 2000 SP3a
    > SQL Server is set to use Trusted or SQL authorization
    > I have added a user X to SQL Server with a password of X
    >
    > I am writing an ASP.NET app on Computer B. IIS and Dev on B) I am
    > trying to make a connection to SQL on computer A but get the
    > error "SQL Server does not exist or access denied"
    >
    > Now when I create a small Winforms app as a test, I can use the exact
    > same connection string and open a connection to SQL Server just fine.
    >
    > So, I'm guessing the problems lies in the security of ASP.NET, but I'm
    > not sure what to change to make this work.
    >
    > BTW, I can also connect just fine with the same user/pw with Enterprise
    > Manger, and Query Analyzer as well as add the connection to Visual
    > Studio
    >
    > Anyone with any ideas?
    >
    > TIA
    > B[/color]


    Comment

    • BW

      #3
      Re: DB Connection


      Database=TESTDA TABASE;Server=M YDBSERVER;user
      id=VALIDUSERNAM E;password=VALI DPASSWORD

      As I said, this same connected string allows me to connect with a Winforms
      test application.



      Thanks

      B



      "Ignacio Machin ( .NET/ C# MVP )" <ignacio.mach in AT dot.state.fl.us > wrote
      in message news:u7NNvxhWFH A.132@TK2MSFTNG P14.phx.gbl...[color=blue]
      > Hi,
      >
      > post your connection string
      >
      > cheerrs,
      >
      > --
      > Ignacio Machin,
      > ignacio.machin AT dot.state.fl.us
      > Florida Department Of Transportation
      >
      >
      >
      > "Brian W" <noneof@yourbus iness.com> wrote in message
      > news:OgFa3VhWFH A.580@TK2MSFTNG P15.phx.gbl...[color=green]
      > > I'm posting here hopeing some here has delt with a similar problem and
      > > has a suggestion for a fix.
      > >
      > > If anyone knows the answer to this I'd me greatly appreciative.
      > >
      > > I am not on a domain.
      > >
      > > I have SQL Server sitting on computer A
      > >
      > > Computer A has:
      > > Windows XP SP2
      > > SQL Server 2000 SP3a
      > > SQL Server is set to use Trusted or SQL authorization
      > > I have added a user X to SQL Server with a password of X
      > >
      > > I am writing an ASP.NET app on Computer B. IIS and Dev on B) I am
      > > trying to make a connection to SQL on computer A but get the
      > > error "SQL Server does not exist or access denied"
      > >
      > > Now when I create a small Winforms app as a test, I can use the exact
      > > same connection string and open a connection to SQL Server just fine.
      > >
      > > So, I'm guessing the problems lies in the security of ASP.NET, but I'm
      > > not sure what to change to make this work.
      > >
      > > BTW, I can also connect just fine with the same user/pw with Enterprise
      > > Manger, and Query Analyzer as well as add the connection to Visual
      > > Studio
      > >
      > > Anyone with any ideas?
      > >
      > > TIA
      > > B[/color]
      >
      >[/color]


      Comment

      • Cor Ligthert

        #4
        Re: DB Connection

        Brian,

        An ASPNET application is using the user AspNetUser or something (see it in
        your userlist, it is a standard user). That one has to be autorised to use
        your database server in a proper way.

        Cor


        Comment

        • Brian W

          #5
          Re: DB Connection

          Sure,

          User ID=VALIDDBUSER; password=VALIDD BUSERPWD;Initia l
          Catalog=MYDATAB ASE;Data Source=MYSERVER ;



          Ignacio Machin ( .NET/ C# MVP ) wrote:
          [color=blue]
          > Hi,
          >
          > post your connection string
          >
          > cheerrs,[/color]

          Comment

          • Brian W

            #6
            Re: DB Connection

            Cor,

            I know that to be [usually] true, however, I am not using a trusted
            connection to the DB. I added a user/pwd and am passing that in the
            connection string.

            B

            Cor Ligthert wrote:
            [color=blue]
            > Brian,
            >
            > An ASPNET application is using the user AspNetUser or something (see
            > it in your userlist, it is a standard user). That one has to be
            > autorised to use your database server in a proper way.
            >
            > Cor[/color]

            Comment

            • Brian W

              #7
              Re: DB Connection

              Anyone?

              Brian W wrote:
              [color=blue]
              > Sure,
              >
              > User ID=VALIDDBUSER; password=VALIDD BUSERPWD;Initia l
              > Catalog=MYDATAB ASE;Data Source=MYSERVER ;
              >
              >
              >
              > Ignacio Machin ( .NET/ C# MVP ) wrote:
              >[color=green]
              > > Hi,
              > >
              > > post your connection string
              > >
              > > cheerrs,[/color][/color]

              Comment

              Working...