SQL Connection help needed

B

Backwards

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.Text.ToString() + ";Initial Catalog=Store;Integrated
Security=SSPI"
Dim sql As New SqlClient.SqlConnection(message)

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
 
G

Guest

Hi,

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

Ken
 
B

Backwards

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
 
A

Andrew Morton

Backwards said:
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

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:-
http://www.connectionstrings.com/

Andrew
 
B

Backwards

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.
 
M

Marina Levit [MVP]

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.
 
B

Backwards

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?
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top