Recent

Author Topic: [Solved] MSSQLConnection with windows authentification  (Read 2309 times)

Zoran

  • Hero Member
  • *****
  • Posts: 1829
    • http://wiki.lazarus.freepascal.org/User:Zoran
[Solved] MSSQLConnection with windows authentification
« on: January 16, 2019, 01:26:58 pm »
By following the wiki, I installed FreeTDS dll files and I managed to connect to MSSQLServer using sql server login.

However, I don't know how to connect using Windows authentification. Is it possible at all with MSSQLConnection?
« Last Edit: January 17, 2019, 03:01:26 pm by Zoran »

Remy Lebeau

  • Hero Member
  • *****
  • Posts: 1312
    • Lebeau Software
Re: MSSQLConnection with windows authentification
« Reply #1 on: January 17, 2019, 12:57:53 am »
Simply leave the UserName and Password properties blank.  This is stated in the TMSSQLConnection documentation:

https://www.freepascal.org/docs-html/fcl/mssqlconn/tmssqlconnection.username.html
https://www.freepascal.org/docs-html/fcl/mssqlconn/tmssqlconnection.password.html

Quote
TMSSQLConnection specific: if you don't enter a UserName and Password, the connector will try to use Trusted Authentication/SSPI (on Windows only).

SSPI is how MSSQL uses Windows authentication.
Remy Lebeau
Lebeau Software - Owner, Developer
Internet Direct (Indy) - Admin, Developer (Support forum)

Zoran

  • Hero Member
  • *****
  • Posts: 1829
    • http://wiki.lazarus.freepascal.org/User:Zoran
Re: MSSQLConnection with windows authentification
« Reply #2 on: January 17, 2019, 03:00:55 pm »
Ah, so simple, I missed it in docs.  :-[
Thank you, Remy, yes it works.

 

TinyPortal © 2005-2018