Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

SQL OLEDB Provider with Windows Authentication? 1

Status
Not open for further replies.

Ovatvvon

Programmer
Feb 1, 2001
1,514
US
Hi,

Does anyone know if it is possible to use a Windows Domain Account for the ADO connection string, rather than a SQL Authentication ID?



-Ovatvvon :-Q
 
absolutely. that would prevent half the capabilities of windows authentication and application development.

that is if your installation was setup to use mixed authentication


____________ signature below ______________
General FAQ faq333-2924
5 steps to asking a question faq333-3811
 
Could you show me how to do it? When I enter the Domain ID, I get a Login failed for user '{Domain-Account}'. Even if I include the domain with the ID, (i.e. {domain}\{account}), it still generates the same error.

Code:
Provider=sqloledb;Data Source={server_name_here};Initial Catalog={database_name_here};User Id={domain_account_here};Password={account_password_here};



-Ovatvvon :-Q
 
is the database server setup for windows authentication?

meaning is it set for mixed mode authentication. and if it is do you have the correct permissions setup no the database for the group/user to access it

maybe you should ask your DBA these questions if you do not have access to these things


____________ signature below ______________
General FAQ faq333-2924
5 steps to asking a question faq333-3811
 
Well, there will always be Windows Authentication, but the SQL authentication is optional, so either way the access is authenticated via Windows. As it turns out, even though I have programmed for years, my present position for the company I am with now is the DBA. So, yes, the account does have access to the database. In fact, for testing purposes, I gave it DBO and SysAdmin permissions. The access to the server via Windows Authentication works fine, except when I'm trying to do it from the code.

It works from the code when I use a SQL ID, but just not the domain account. So that's why I am wondering if Windows Authentication can be used with ADO. Are there any special parameters / settings I need to specify to tell it to use Windows Authentication over SQL Authentication?

(btw, I don't think it matters, but we're using SQL Server 2005)

-Ovatvvon :-Q
 
I would recommend the site


and I think it's this you are looking for.

Code:
 Trusted Connection:

"Data Source=Aron1;Initial Catalog=pubs;Integrated Security=SSPI;" 
   - or -
"Server=Aron1;Database=pubs;Trusted_Connection=True;" 
   (both connection strings produces the same result)

(use serverName\instanceName as Data Source to use an specifik SQLServer instance)



Christiaan Baes
Belgium

"My new site" - Me
 
Excellent Chrissie1!!

The Integrated Security=SSPI worked!

I owe ya one! =)

*Star for you*

-Ovatvvon :-Q
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top