Page 1 of 1

MS SQL 2005 - Windows authentication

Posted: Sun Sep 19, 2010 6:15 pm
by Haruks
Hello all,

Have any way to connect to MSSQL server 2005/2008 using Trusted_Connection or Integrated
Security (Windows authentication)?

Best regards.

Re: MS SQL 2005 - Windows authentication

Posted: Tue Sep 21, 2010 8:31 am
by noorderling
I did through odbc, that worked ok for me.

Re: MS SQL 2005 - Windows authentication

Posted: Tue Sep 21, 2010 1:48 pm
by Haruks
Hello noorderling, Thanks for your reply,

did you make a connection to MSSQL using ODBC with Windows authentication?
can you post your code?

Thank you.

Re: MS SQL 2005 - Windows authentication

Posted: Wed Sep 22, 2010 7:48 am
by noorderling
It's a 2-step thing:

First the hard part: make a user-odbc* with the help of odbc manager, and save it.
This is where you select if network login or user/pass is used to access the database.
You can validate the login here before saving.
This part I did not by coding, but manually in systemmanager.

In PB than initialize the odbc driver by useodbcdatabase().
You than call opendatabase(#db, "odbc-name just created", user, pass) with nullstring or empty string for user/pass.

* or machine if it is to be for every user on that machine.