SQL Connection help needed

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

    #1

    SQL Connection help needed

    I'm using visual studio 2005 and SQL 2000, trying to connect to a sql
    database as a differnent user.

    Here is my current connection string that is using my own NT login:

    Dim message As String = "Data Source=" +
    Me.ComboBox1.Te xt.ToString() + ";Initial Catalog=Store;I ntegrated
    Security=SSPI"
    Dim sql As New SqlClient.SqlCo nnection(messag e)

    sql.Open()

    I have access to this database and the connection establishes fine.
    However i dont have access to certain Stored Procedure's on this
    database and these run through a differnt NT user.

    I dont have access to a SQL user name and password so i cant hardcode
    the "sa" login instead.

    Does anyone know if i can change my connection string above to use
    another windows/NT login?

    Awaiting reply,
    Andy

  • Ken Tucker [MVP]

    #2
    RE: SQL Connection help needed

    Hi,

    I would talk to your data base administrator and see if you can
    be given access to the stored procedure.

    Ken
    -------------

    "Backwards" wrote:
    [color=blue]
    > I'm using visual studio 2005 and SQL 2000, trying to connect to a sql
    > database as a differnent user.
    >
    > Here is my current connection string that is using my own NT login:
    >
    > Dim message As String = "Data Source=" +
    > Me.ComboBox1.Te xt.ToString() + ";Initial Catalog=Store;I ntegrated
    > Security=SSPI"
    > Dim sql As New SqlClient.SqlCo nnection(messag e)
    >
    > sql.Open()
    >
    > I have access to this database and the connection establishes fine.
    > However i dont have access to certain Stored Procedure's on this
    > database and these run through a differnt NT user.
    >
    > I dont have access to a SQL user name and password so i cant hardcode
    > the "sa" login instead.
    >
    > Does anyone know if i can change my connection string above to use
    > another windows/NT login?
    >
    > Awaiting reply,
    > Andy
    >
    >[/color]

    Comment

    • Backwards

      #3
      Re: SQL Connection help needed

      I have spoken with our DBA's and have been instructed to logon and run
      it as this user so they can track the usage of the stored procedure

      Andy

      Comment

      • Andrew Morton

        #4
        Re: SQL Connection help needed

        Backwards wrote:[color=blue]
        > I have spoken with our DBA's and have been instructed to logon and run
        > it as this user so they can track the usage of the stored procedure[/color]

        And they're too mean to tell you you need to supply the User ID and Password
        parameters in the connection string?

        This may help:-
        All connection strings in one place. Find the syntax for your database connection using ADO.NET, ADO, ODBC, OLEDB, C#, VB, VB.NET, ASP.NET and more.


        Andrew


        Comment

        • Backwards

          #5
          Re: SQL Connection help needed

          The only problem is the username and password you can pass in the
          string tries to connect using SQL not windows logins.
          Nice link though, good one to hold onto.

          Comment

          • Marina Levit [MVP]

            #6
            Re: SQL Connection help needed

            This means you can't run the stored procedure if you connect using
            integrated and running as yourself.

            You need to either:
            1) run as this other user, meaning their NT login, so windows auth works
            2) Have your DB Admin give your NT login access to the stored procedure
            3) Not use windows auth, but use a SQL login, that does have access to the
            stored procedure

            Since, I doubt #1 is an option here, it's really up to your DB admin to do
            some work and give you access in some way to the stored procedure.

            "Backwards" <Andrew@technic altraining.co.n z> wrote in message
            news:1145437775 .650278.321540@ z34g2000cwc.goo glegroups.com.. .[color=blue]
            > I'm using visual studio 2005 and SQL 2000, trying to connect to a sql
            > database as a differnent user.
            >
            > Here is my current connection string that is using my own NT login:
            >
            > Dim message As String = "Data Source=" +
            > Me.ComboBox1.Te xt.ToString() + ";Initial Catalog=Store;I ntegrated
            > Security=SSPI"
            > Dim sql As New SqlClient.SqlCo nnection(messag e)
            >
            > sql.Open()
            >
            > I have access to this database and the connection establishes fine.
            > However i dont have access to certain Stored Procedure's on this
            > database and these run through a differnt NT user.
            >
            > I dont have access to a SQL user name and password so i cant hardcode
            > the "sa" login instead.
            >
            > Does anyone know if i can change my connection string above to use
            > another windows/NT login?
            >
            > Awaiting reply,
            > Andy
            >[/color]


            Comment

            • Backwards

              #7
              Re: SQL Connection help needed

              So what your saying is that the .net framwork 2.0 doesnt support a sql
              connection as another windows user but only a SQL user?

              Comment

              Working...