• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 589
  • Last Modified:

ADO connection with Windows Authentication

Hi,

I want to establish a secure connection with ADO to a SQL server, but I want to do it with alternate credentials (ie not the account I am logged on with).  I am using VB to create an application, and I'm using the following connection string:

"Trusted_Connection=Yes;Driver={SQL Server};Server=" & _
        strSQLServer & ";Database=" & strDatabase & ";User Id=" & _
        strSQLUser & ";Password=" & strSQLPassword

It seems to ignore the User ID and Password, and use my currently logged on credentials.

Thanks for the help.
0
ojfahoum
Asked:
ojfahoum
  • 2
1 Solution
 
arbertCommented:
You cannot use TRUSTED CONNECTION if you want to supply userid/passord.  The SQL Server must also be setup to allow SQL Authentication.
0
 
ojfahoumAuthor Commented:
Is there a way to encrypt the username and password over SQL Authentication?
0
 
arbertCommented:
Only if you enable the "Force Protocol Encryption":

http://www.mcse.ms/archive97-2003-12-144373.html
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now