POOK-101
asked on
SQL windows Authentication without being logged in as that Domain account
Is there a way to do a SQL windows Authentication without being logged in as that Domain account.
I am working on a VBS script that connects to a SQL 2008 Database. I’m logged into my workstation with “Domain Account 1”, and the database only has permission for “Domain account 2”. I cannot get the VBS script to connect to the database.
* An SQL account is not an option per our SRM team.
This is the code I'm using.
It fails with an error as follows
SQL_Connection_Test.vbs(39 , 1) Microsoft OLE DB Provider for SQL Server: Login failed for user domain\account2.
I am working on a VBS script that connects to a SQL 2008 Database. I’m logged into my workstation with “Domain Account 1”, and the database only has permission for “Domain account 2”. I cannot get the VBS script to connect to the database.
* An SQL account is not an option per our SRM team.
This is the code I'm using.
strConnect = "Provider=SQLOLEDB.1;Password=xxxxxxx!;Persist Security Info=True;User ID=domain\account2;Initial Catalog=MYDB;Data Source=MYSERVERNAME"
Set objConnection = CreateObject("ADODB.Connection")
objConnection.ConnectionString = strConnect
Err.Clear
objConnection.Open
It fails with an error as follows
SQL_Connection_Test.vbs(39
ASKER
I was hoping i didn't have to do that. The script will be accessing file servers (and logging to the database).
The "domain\account2" does not have access to the File Servers.
The "domain\account2" does not have access to the File Servers.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
https://technet.microsoft.com/pt-br/library/cc771525(v=ws.10).aspx