TimPeer
asked on
QT ODBC Plugin
When I attempt to build the plug in I receive the following message on Windows XP XP3.
The Readme in the ODBC directory referenced sql-driver.html
Set Environment Variables from the QT Command Prompt:
QT OpenSource Version is running.
Is ODBC support installed with the OpenSource release?
DEBUG 1: Project file: reading C:/Qt/2010.05/qt/src/plugins/sqldrivers/odbc/odbc
.pro
DEBUG 1: Project Parser: c:\Qt\2010.05\qt\src\plugins\sqldrivers\odbc\odbc.pro:9
: Test (first) failed.
c:\Qt\2010.05\qt\src\plugins\sqldrivers\odbc\odbc.pro:9: Parse Error ('first: al
l')
Error processing project file: odbc.pro
C:\Qt\2010.05\qt\src\plugins\sqldrivers\odbc>
The Readme in the ODBC directory referenced sql-driver.html
cd %QTDIR%\plugins\src\sqldrivers\odbc
qmake -o Makefile odbc.pro -D [added]
nmake
Set Environment Variables from the QT Command Prompt:
QMAKESPEC=win32-g++
QTDIR=C:\Qt\2010.05\qt
QTJAVA=C:\Program Files\QuickTime\QTSystem\QTJava.zip
QT OpenSource Version is running.
Is ODBC support installed with the OpenSource release?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
what database are you trying to connect to ?
ASKER
My QT application to a generic ODBC driver. Actual database is an Oracle Rdb relational database and a SQL Server database from multiple threads.
Seems more complicated than it is. From a QT application:
Open ODBC connection Rdb.
Fetch data
Read data
Insert/Update/Delete SQL Server tables
Seems more complicated than it is. From a QT application:
Open ODBC connection Rdb.
Fetch data
Read data
Insert/Update/Delete SQL Server tables
have you tried something along these lines
used the ODBC Data Source Administrator GUI to add a system DSN named "SqlDataSource" that uses driver "SQL Native Client".
used the ODBC Data Source Administrator GUI to add a system DSN named "SqlDataSource" that uses driver "SQL Native Client".
/ initialize return code for sql operation status
RETCODE returnCode;
// initialize handles
SQLHENV handleEnvironment;
SQLHDBC handleConnection;
SQLHSTMT handleStatement;
// allocate environment handle
SQLAllocHandle(SQL_HANDLE_ENV, SQL_NULL_HANDLE, &handleEnvironment);
// set odbc driver version for environment
SQLSetEnvAttr(handleEnvironment,SQL_ATTR_ODBC_VERSION,(void *)SQL_OV_ODBC3, 0);
// allocate connection handle
SQLAllocHandle(SQL_HANDLE_DBC, handleEnvironment, &handleConnection);
// connect to database
SQLRETURN ret;
ret = SQLDriverConnect(handleConnection, NULL, (SQLWCHAR*)TEXT("DRIVER={SQL Native Client};SERVER=MyComputerName;DATABASE=MyDatabase;Trusted_Connection=yes;"), SQL_NTS, NULL, 0, NULL, SQL_DRIVER_NOPROMPT);
// report status
cout << ret << "\t" << SQL_SUCCEEDED(ret) << endl;
if (SQL_SUCCEEDED(ret)) cout << "Connected" << endl;
else cout << "Connection failed" << endl;
ASKER
I wrote an entire framework for ODBC and am looking for a type safe replacement which is why I am leaning toward QT. If necessary, I may consider creating hybrid classes based on the QT model but, my preference is to implement a "standard" framework... I just don't want to pay 4K for ODBC.
Thanks for the suggestion.
ve3ofa suggested EasyODBC which seemed a option except the functionality built specifically for QT unix, I need on the Windows platform. From what I read, the QT ODBC driver for UNIX is not compatible with Windows from what I read.
I may contact EASYODBC tomorrow and ask the sales desk for advise in this regard.
Thanks for the suggestion.
ve3ofa suggested EasyODBC which seemed a option except the functionality built specifically for QT unix, I need on the Windows platform. From what I read, the QT ODBC driver for UNIX is not compatible with Windows from what I read.
I may contact EASYODBC tomorrow and ask the sales desk for advise in this regard.
you might want to look at this mysql implentation http://www.pikopong.com/blog/2010/04/11/how-to-enable-mysql-support-in-qt-sdk-for-windows/
another source http://www.qtcentre.org/archive/index.php/t-26296.html
I use Visual studio you might want to get the plugin for VStudio and use one of the free express versions
I use Visual studio you might want to get the plugin for VStudio and use one of the free express versions
ASKER
The question is not abandoned. I would continue to accept suggestions for QT ODBC options.
ASKER
I downloaded the pricey commercial version and ODBC works as published. But save for the hefty price tag, am looking for options to implement ODBC with QT.
Using the commercial version, I managed to complete roughly 40% of the ODBC engine for the app. Having an ODBC alternative at hand I would consider a purchase depending on the cost.
Many thanks!