Link to home
Create AccountLog in
Avatar of Storminator16
Storminator16

asked on

Can an Active Directory service account be used for an ODBC connection?

When creating a ODBC System data source (because I have an application that requires this), I used a Sql Server account and tested my connection; this worked fine. Under guidance due to our domain standards, I've been told to use a trused Windows NT account instead. I was provided with a service account name and it's password, but when testing the connection it fails. So, can an Active Directory service account be used at all, or is their possibly something else wrong? Thanks in advance.
Avatar of DBoyes
DBoyes

The Domain/Trusted account needs to be known by SQL Server, and needs to have at least the same rights as the SQL User name you were previously testing with.

If you are not an admin on the SQL Server, you will need to have someone who is check this for you. I would hope that because you were given a domain account name to use, that it already has rights on the SQL Server to some extent. It may just need adding to your particular Database, or Table(s).

Good Luck!

David.
Oh, when it is all set up, the way you define the conection string will change...

Right now, you probably have something like...

"Driver={SQL Server};Server=myServerAddress;Database=myDataBase;Uid=myUsername;Pwd=myPassword;"

which you will want to change to...

"Driver={SQL Server};Server=myServerAddress;Database=myDataBase;Trusted_Connection=Yes;"

Let me know if that helps.
Regards,

David.
Avatar of Storminator16

ASKER

Ok, assume everything is kosher.  Can a service account be used in an odbc connection?
By service account, I assume you mean a regular domain ID that has been created by a domain admin, but which is not "tied" to a particular individual, so it is designed to be used for programmatic connectivity, rather than a user's personal access to the domain? If so, then I do not see why this would not work. Your application should be running as the domain ID that has been set up for you (service account), as the "Trusted_Connection = Yes" part of the connection string will want to pass the domain credentials of the user account which is running your application.

I'm not a huge fan of using a trusted connection for exactly this reason, and much prefer to set up a generic (and extremely locked down) SQL server account for each application.

Let me know if this helps any.
Thanks!

David.
ASKER CERTIFIED SOLUTION
Avatar of DBoyes
DBoyes

Link to home
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
See answer