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.
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
It fails with an error as follows
, 1) Microsoft OLE DB Provider for SQL Server: Login failed for user domain\account2.