Impersonation with VB.net 2.0 and SQL 2000 help needed

  • Thread starter Thread starter Backwards
  • Start date Start date
B

Backwards

Hey everybody

I'm having a little trouble getting access to a few commands in our 65
odd SQL databases.
Have had a chat to our DBA's and they wont give my windows account
access and they also wont give me a SQL login in order to run these
tasks. :-(

The good news is that i do have access to run these certian tasks as
another NT user.

The bad news is i cant add this to my connection string.

The lovely people at Microsoft talked about using Impersonation?

Would this work and how would i go about using this with VB.net 2.0
(visual studio 20005)

Any help on this would be great,

Andy
 
Use Run As when you start your executable.

--
____________________________________
William (Bill) Vaughn
Author, Mentor, Consultant
Microsoft MVP
INETA Speaker
www.betav.com/blog/billva
www.betav.com
Please reply only to the newsgroup so that others can benefit.
This posting is provided "AS IS" with no warranties, and confers no rights.
__________________________________
 
That works but its a major hassle when you have to do it all the time.
Is there anything else i can do?
 
What type of you app is, Win form or ASP.NET?

In either case, if the DBA only allows Windows Security on the SQL Server,
then you have to know which Windows user account is running your app. If it
is Win form app, the logged in use is the user account that runs your app
(unless you use "RUNAS" command and supply different user credential). So,
if that user has appropriate access to the SQL Server, your app would run as
expected. If he does not have sufficient access, that is good, this is what
security is meant to. Have someone else who has access privilege to run the
app, not the ones who are not supposed to. Also, with .NET Configuration
applet, you can manipulate .NET app/code security on the computer where your
app runs


If it is ASP.NET, the user account running your ASP.NET app may not be (by
default) the user who open a web browser and navigate to your app on a web
server. You must know, as developer, which account is used to run the
ASP.NET app in order to give the account proper access to required resource,
such as SQL Server. Impersonation is one of the option.

However, for some reason, you have to use SQL Server security, not Windows
security, while the DBA does not accept it, then it is only between you two
to make compromise, nothing can help.
 
Its a windows app rather than a web app. I have another windows user
account that can run this and looks like i'll have to just use the
"RunAs" command.

Thanks a bunch for your input.
 
¤ Hey everybody
¤
¤ I'm having a little trouble getting access to a few commands in our 65
¤ odd SQL databases.
¤ Have had a chat to our DBA's and they wont give my windows account
¤ access and they also wont give me a SQL login in order to run these
¤ tasks. :-(
¤
¤ The good news is that i do have access to run these certian tasks as
¤ another NT user.
¤
¤ The bad news is i cant add this to my connection string.
¤
¤ The lovely people at Microsoft talked about using Impersonation?
¤
¤ Would this work and how would i go about using this with VB.net 2.0
¤ (visual studio 20005)
¤

The following may work for you:

http://msdn2.microsoft.com/en-us/li...cipal.windowsimpersonationcontext(VS.80).aspx


Paul
~~~~
Microsoft MVP (Visual Basic)
 
Back
Top