Hello everybody,
i am creating an application for which I want to use Qt and MS SQL. I want Qt desginer which is running on linux to access MS SQL server which is on windows machine. if any one has done this then plz help me.
Hello everybody,
i am creating an application for which I want to use Qt and MS SQL. I want Qt desginer which is running on linux to access MS SQL server which is on windows machine. if any one has done this then plz help me.
Hi,
I did a proxy that connect to a SQL Server. I used the FreeTDS SQL driver (http://www.freetds.org/) compiled with Qt (using the --qt-sql-tds configure directive). I fallowed Qt instructions and it worked fine.
The proxy uses a store procedure to query data, so I only read the DB (I did not test write queries). I used both Qt3 and Qt4, but with Qt3 the program leaked when the query failed in some cases. At the beginning I thought that was something wrong with my code, but when I ported it to Qt4 the leak was gone. I tried debug it with valgrind, but the log generated is really big and sometimes enigmatic.
manish_pesit (4th September 2006)
I configured that one with unixODBC and freeTDS. from command prompt I am able to create , read and all basic operations to MS SQL. But in order to make use it in Qt program what will be the driver name?Originally Posted by Zatraz
You will connect to SQL Server using FreeTDS plugin with something like this:
Qt Code:
// Note: QT4 db.setDatabaseName(database); db.setHostName(host); db.setUserName(user); db.setPassword(pass); setenv("TDSVER", "8.0", 1); setenv("TDSPORT", dbport, 1); //! setPort() does not work properly if (!db.open()) { qWarning("Erro opening database connection: " + db.lastError().text()); return 1; }To copy to clipboard, switch view to plain text mode
Last edited by Zatraz; 4th September 2006 at 17:48.
If I am using the above code then it throws an error :Originally Posted by Zatraz
QSqlDatabase: QTDS7 driver not loaded
QSqlDatabase: available drivers: QODBC3
Can you tell me from where I will get QTDS7 driver?
thanks
Bookmarks