473,795 Members | 2,812 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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

Apr 19 '06 #1
6 1240
Hi,

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

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

"Backwards" wrote:
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

Apr 19 '06 #2
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

Apr 19 '06 #3
Backwards wrote:
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
Apr 19 '06 #4
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.

Apr 19 '06 #5
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" <An****@technic altraining.co.n z> wrote in message
news:11******** **************@ z34g2000cwc.goo glegroups.com.. .
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

Apr 19 '06 #6
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?

Apr 19 '06 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
2043
by: Ryan P. Kennedy | last post by:
Hi: I have a Point-of-sale application that uses SQL Server2000 for the backend. Basically, the users perform various functions boiling down to login (check password from a table) and data entry (insert a food entry). Previously, I would open a new ADO 2.7 connection to the database each time one of these types of database accessing functions needed to be performed - but I noticed that sometimes the DB would freeze the application for...
2
3501
by: Bryan | last post by:
Hello, I'm just starting to develop in asp.net and i have a question about using a database connection globally in my app. I have set up the procedures for getting all my connection string info which each page will use, but my question relates to how to use the database connection i create in all my classes. I have a database class, in a separate namespace and file, i created that handles all the connection opening, executing statements...
35
11422
by: Eric Sabine | last post by:
In my Finally block, I was using cn.close (where cn is an ADO.NET connection object, SQLConnection to be exact) and then I came across the following in some microsoft code. If Not cn Is Nothing Then CType(cn, IDisposable).Dispose() End If I have to admit, I'm not sure what happens here. Will someone explain this line of code (the middle one, not the if statement LOL) to me please?
35
4851
by: Terry Jolly | last post by:
Web Solution Goal: Have a global database connection Why: (There will be 30+ tables, represented by 30+ classes) I only want to reference the database connection once. I put the connection string in the web.config. I created a class with a static database connection and the class opens and closes the database.
1
6069
by: Sankalp | last post by:
Hi, I am using VB 2005. My application has many data bound controls. The connection is stored in the app.config file. I want the application to start with a default connection string and while during the runtime, the user can click on a button and change the connection string without exiting the application. I would really appreciate any sort of help.
3
4893
by: fniles | last post by:
In the Windows application (using VB.NET 2005) I use connection pooling like the following: In the main form load I open a connection using a connection string that I stored in a global variable g_sConnectionString and leave this connection open and not close it until it exits the application. Then on each thread/each subsequent sub that needs the connection I create a local OleDBConnection variable, open the connection using the exact...
13
2848
by: Jennifer.Berube | last post by:
well I'm not sure how to go about making my SQL connection string... The code below is what I need to replace with my SQL connection...I just don't know if that code is for DSN or access... I don't want to use DSN just a connection string...help? function GetConnection() const DSN = "membershipdb" const UID = "webuser"
1
1213
by: archana | last post by:
Hi all, I am new to asp.net. I am developing one application. I want to open and close connection for session. Means when user first time logged in i want to open connection and store that in session. and when user logged off close connection. But what if user IE only. How will i handle this situlaton. Please help me asap.
2
1364
by: pmclinn | last post by:
When I'm connecting to Oracle or SQL I always wonder what is the best way to close/dispose of a connection. I've been toying around with creating a public shared class that has a connection string and then calling on the shared class when needed. (See raw examples below.) If two of my users open up two different pages at the same time will this still work. And if so should I pre-test to see if the connection state is already open using...
3
1456
by: John | last post by:
Hi I have a windows form app with one master table and several details (grids). As I am filling both the master and details using vs 2005 generated dataset and data adapters, there are multiple connection open/close during the whole operation (one connection open/close per adapter fill). Is there a way to override the vs generated connection management code to open the connection only once at start, do all fills and then close the...
0
9673
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10216
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10165
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10002
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7543
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6783
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5565
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4113
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3728
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.