hi,
i would like you to help me with the problem of the connection between qt and database postgresql
i download QT 4.7.3
and postgresql 9.1.1
windows 7
and i downloaded the connector odbc postgresql to create a database source in order to connect qt with postgresql, this is the code that i wrote but i had a message error
driver not loaded
#include <QtGui/QApplication>
#include "mainwindow.h"
#include<QtSql>
#include<QtDebug>
#include<Iostream>
int main(int argc, char *argv[])
{
QApplication a(argc, argv);
QSqlDatabase db=QSqlDatabase::addDatabase("QSQLITE");
db.setHostName("localhost");
db.setDatabaseName("dsi64");
db.setPassword("123");
db.setUserName("postgres");
if(db.open())
{
qDebug() <<"opened" ;
db.close();
}
else
{
qDebug() << db.lastError().text();
}
MainWindow w;
w.show();
return a.exec();
}
please can you help me
Bookmarks