hello,
i want to work with QSqlDatabase and QSqlQuery so
i included the following file
#include <QtSql>
but i get a message say :
Can not open include file :QtSql no such file or directory
what is wrong?
hello,
i want to work with QSqlDatabase and QSqlQuery so
i included the following file
#include <QtSql>
but i get a message say :
Can not open include file :QtSql no such file or directory
what is wrong?
Hi
you should
Qt Code:
#include <QSqlDatabase> #include <QSqlQuery> #include <QSqlError>To copy to clipboard, switch view to plain text mode
1st one being for database objects
2nd for queries
3rd for meaningful output for any error
HTH,
Pedro Doria Meunier
Only QtCore and QtGui modules are enabled by default. To add suitable include paths and to link against QtSql module, add this line to your qmake .pro file:
J-P Nurmi
i am using visual studio 2005 and there is no .pro file!!!!
Last edited by mismael85; 6th March 2008 at 16:55.
That's a pity. Nobody else can build your project with any other compiler then. Because of that, it is ALWAYS a good idea to maintain a qmake .pro file even if you used this or that IDE.
Provided that you're using the Visual Studio integration, you can open context menu over the project item in solution explorer. There's a menu item to choose Qt modules.
J-P Nurmi
mismael85 (6th March 2008)
i used MinGw with a static version of Qt and i added
Qt += sql
to the *.pro file
and it is also say that there is no such file or directory!!!
The variable name is QT, not Qt.
J-P Nurmi
thank you for your help .
for visual studio i did just as you said and it worked fine.
and for Mingw32-make
i added Qt += sql but it was wrong
because *.pro file is case sensitive and it must be
QT += sql
when i did that every thing worked fine.
thank you again.
Thanks all
Bookmarks