Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
SQL Server - Connection string
#1
Hi !

I'm working on my first big project for the company i'm working for. And the app i'm developing needs to connect to the company's SQL Databases in order to work.

But i'm struggling with the following issue :
- The Databases are "Microsoft SQL Server"
- To authenticate, they are using Microsoft Authentification (AD account). It means that they gave on my AD account, read+write rights on the SQL Databases, for dev purposes.
- Actually, with QM, here is the connection string i use and that works :
Macro Macro5
Code:
Copy      Help
;;Connect to DB
str strConnect = "Provider=sqloledb;Data Source=PRODUDCTIONCLUSQL01\CLU01;Initial Catalog=PRODTABLE;Integrated Security = SSPI;"
Database db.Open(strConnect)


Once it's finished, my app will be used by other employee to work with. But here is the issue :
As i mentioned, at the moment to authenticate to the Databases, i'm using my AD account which have R+W access. The other employees that will use my app won't have R+W access on their AD account.

So i asked "Hey ! Why not create a simple SQL user on the server just for my app to log on the databases that i can specify user/password in the connection string ?"
Their answer was no Big Grin Instead they say "Let's create an 'AD service account' that will have R+W access and use it to connect in your code."

I searched on several websites, and they all say that it's not possible to specify another Windows account credential in an SQL connection string.
So i try to find workarounds, like using the "Runas" function that will run my app using the Account they will provide me :

Macro Macro5
Code:
Copy      Help
RunAs("C:\My_application.exe" "" "SERVICEACCOUNTNAME" "DOMAINNAME" "[*ENCRYPTEDPASSWORD*]")


Do you think it's the only solution ? Is there a "Cleaner way" ?

Thanks in advance Smile


Forum Jump:


Users browsing this thread: 1 Guest(s)