Link to home
Start Free TrialLog in
Avatar of TimPeer
TimPeer

asked on

QT ODBC Plugin

When I attempt to build the plug in I receive the following message on Windows XP XP3.
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>

Open in new window


The Readme in the ODBC directory referenced sql-driver.html
cd %QTDIR%\plugins\src\sqldrivers\odbc
qmake -o Makefile odbc.pro -D [added]
nmake

Open in new window


 
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

Open in new window



QT OpenSource Version is running.

Is ODBC support installed with the OpenSource release?


ASKER CERTIFIED SOLUTION
Avatar of David Johnson, CD
David Johnson, CD
Flag of Canada image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of TimPeer
TimPeer

ASKER

I don't think it will work, Easysoft is an odbc interface for Unix. Does Easysoft support ODBC on Windows?

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!
what database are you trying to connect to ?
Avatar of TimPeer

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
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".  
/ 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;

Open in new window

Avatar of TimPeer

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.
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
Avatar of TimPeer

ASKER

The question is not abandoned. I would continue to accept suggestions for QT ODBC options.