PDA

View Full Version : postgre SQL connection



jsmith
11th May 2009, 11:06
hi,
i want to connect to postgre sql database.

for that i checked available drivers through qt program.


bool a=db.isDriverAvailable(QODBC);

here a=0;
i have only QSQLITE .
but for postgresql QODBC/QPSQL required
so i tried to build ODBC in the following way. but iam getting error



D:\>cd qt\4.4.3\src\plugins\sqldrivers\odbc

D:\Qt\4.4.3\src\plugins\sqldrivers\odbc>qmake -o Makefile odbc.pro

D:\Qt\4.4.3\src\plugins\sqldrivers\odbc>nmake


Microsoft (R) Program Maintenance Utility Version 6.00.8168.0
Copyright (C) Microsoft Corp 1988-1998. All rights reserved.

NMAKE -f Makefile.Debug all

Microsoft (R) Program Maintenance Utility Version 6.00.8168.0
Copyright (C) Microsoft Corp 1988-1998. All rights reserved.

rc -D_DEBUG -DUNICODE -DQT_LARGEFILE_SUPPORT -DQT_NO_CAST_TO_ASCII -DQT_
NO_CAST_FROM_ASCII -DQT_DLL -DQT_PLUGIN -DQT_SQL_LIB -DQT_CORE_LIB -DQT_THREAD_S
UPPORT -fo tmp\obj\debug_shared\qsqlodbcd_resource.res qsqlodbcd_resource.rc
qsqlodbcd_resource.rc(4) : fatal error RC1015: cannot open include file 'winver.
h'.
NMAKE : fatal error U1077: 'rc' : return code '0x1'
Stop.
NMAKE : fatal error U1077: '"C:\Program Files\Microsoft Visual Studio\VC98\bin\N
MAKE.EXE"' : return code '0x2'
Stop.

can anyone help me ?

thanks in advance.

ComaWhite
11th May 2009, 16:29
Stop using Visual C++ 6. Get the newer version 2008

lyuts
12th May 2009, 12:22
You don't need to QODBC for PostgreSQL. QPSQL will be enough.
Take a look at docs on how to build this plugin.