How can i get data from existing MSSQL database to a Qt applicaion.. im using sql with Qt for the first time....so
if u can,please include a complete example code.. thanks
How can i get data from existing MSSQL database to a Qt applicaion.. im using sql with Qt for the first time....so
if u can,please include a complete example code.. thanks
You have to use a QODBC driver.
for example code see the official documentation
A camel can go 14 days without drink,
I can't!!!
deepal_de (13th July 2011)
WebDataBase is a DB thats in my MSSQLEXPRESS sever..
Qt Code:
qDb.setDatabaseName("DRIVER={Microsoft Access Driver (*.mdb)};FIL={MS Access};DBQ=WebDataBase.mdb"); if (qDb.open()) { } else { }To copy to clipboard, switch view to plain text mode
this doesn't work!
how to chage the "qDb.setDatabaseName" to work with MSSQLEXPRESS
I never used MSSQL,
however you have to set a correct ODBC configuration string (you used a Access Driver)
I found this
Qt Code:
"Driver={SQLServer};Server=Your_Server_Name;Database=Your_Database_Name;Uid=Your_Username;Pwd=Your_Password;"To copy to clipboard, switch view to plain text mode
Last edited by mcosta; 13th July 2011 at 08:12. Reason: updated contents
A camel can go 14 days without drink,
I can't!!!
deepal_de (13th July 2011)
Bookmarks