Avatar of 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
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
Error processing project file: odbc.pro

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]

Open in new window

Set Environment Variables from the QT Command Prompt:
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?

C++Windows XPLinux

Avatar of undefined
Last Comment
Avatar of David Johnson, CD
David Johnson, CD
Flag of Canada image

Blurred text
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
Avatar of TimPeer


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


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
	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


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


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

Microsoft Windows XP is the sixth release of the NT series of operating systems, and was the first to be marketed in a variety of editions: XP Home and XP Professional, designed for business and power users. The advanced features in XP Professional are generally disabled in Home Edition, but are there and can be activated. There were two 64-bit editions, an embedded edition and a tablet edition.

Top Experts
Get a personalized solution from industry experts
Ask the experts
Read over 600 more reviews


IBM logoIntel logoMicrosoft logoUbisoft logoSAP logo
Qualcomm logoCitrix Systems logoWorkday logoErnst & Young logo
High performer badgeUsers love us badge
LinkedIn logoFacebook logoX logoInstagram logoTikTok logoYouTube logo