I have an Excel workbook that will query a SQL Server 2012 database using VBA. Many users will temporarily use this workbook so I created a generic ID with SQL Server credentials only. Some of the users can execute the VBA and retrieve data without a problem. When other users try, the VBA ignores the provided coection string using the generic user and password and provides their windows credentials. Why are they sending their windows credentials instead of the credentials provided in the coection string? How do I force the coection to use the provided Uid and Pwd?
The error message is
Coection Failed:
SQL State '28000'
SQL Server Error 18456
...Login failed for user 'DomainUserid'
The database server security is set up to use both SQL Server and Windows authentication.
The coection string is:
costring = "ODBC;Driver=SQL Server;Server=" & Server & ";Database=" & DBTarget & ";Uid=" & Whoisit & ";Pwd=" & Authword & ";"
They're all ruing Windows 7 Enterprise and Office 2010. They're all on the same network domain.
