Important: Please read the Qt Code of Conduct -

How to connect to an SQL server using Windows authentication using qt?

  • Hi, As of now i am using the below part of code to connect to SQL server. But I need to connect to SQL server using Windows authentication. Kindly help me out to connect SQL server using Windows authentication.

    Here is the code, its working fine and able to connect the SQL server using SQL server Authentication:
    dbase.setDatabaseName(QString("DRIVER={SQL Server};"

    Thanks in advance!

  • @Mounish
    Is the driver string you show for Microsoft SQL Server? (If so, I hadn't heard of Uid= or Pwd=, but there you are.) Whatever it is for, what does that database driver documentation say is the syntax for using Win Auth?

Log in to reply