Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

ADO connection with Windows Authentication

Posted on 2004-04-20
3
Medium Priority
?
584 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 34

Accepted Solution

by:
arbert earned 1500 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

Enterprise Mobility and BYOD For Dummies

Like “For Dummies” books, you can read this in whatever order you choose and learn about mobility and BYOD; and how to put a competitive mobile infrastructure in place. Developed for SMBs and large enterprises alike, you will find helpful use cases, planning, and implementation.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In this article we will learn how to fix  “Cannot install SQL Server 2014 Service Pack 2: Unable to install windows installer msi file” error ?
In part one, we reviewed the prerequisites required for installing SQL Server vNext. In this part we will explore how to install Microsoft's SQL Server on Ubuntu 16.04.
Via a live example, show how to extract insert data into a SQL Server database table using the Import/Export option and Bulk Insert.
Viewers will learn how the fundamental information of how to create a table.

705 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