Solved

ADO connection with Windows Authentication

Posted on 2004-04-20
3
537 Views
Last Modified: 2012-06-27
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
Comment
Question by:ojfahoum
  • 2
3 Comments
 
LVL 34

Accepted Solution

by:
arbert earned 500 total points
ID: 10870930
You cannot use TRUSTED CONNECTION if you want to supply userid/passord.  The SQL Server must also be setup to allow SQL Authentication.
0
 

Author Comment

by:ojfahoum
ID: 10870942
Is there a way to encrypt the username and password over SQL Authentication?
0
 
LVL 34

Expert Comment

by:arbert
ID: 10871012
Only if you enable the "Force Protocol Encryption":

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

Featured Post

What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

Join & Write a Comment

Having an SQL database can be a big investment for a small company. Hardware, setup and of course, the price of software all add up to a big bill that some companies may not be able to absorb.  Luckily, there is a free version SQL Express, but does …
JSON is being used more and more, besides XML, and you surely wanted to parse the data out into SQL instead of doing it in some Javascript. The below function in SQL Server can do the job for you, returning a quick table with the parsed data.
Via a live example, show how to set up a backup for SQL Server using a Maintenance Plan and how to schedule the job into SQL Server Agent.
Viewers will learn how to use the UPDATE and DELETE statements to change or remove existing data from their tables. Make a table: Update a specific column given a specific row using the UPDATE statement: Remove a set of values using the DELETE s…

758 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now