hi everyone, I have struggled for a long time with trying to connect my progam to a PostgreSQL database. At first I tried connecting my program to a mysql database but after a long time of trying to building the mysql driver i gave up and tried a different database (i.e. Postgresql) and still can't connect even with postgresql. code below.Qt Code:
{ // threadPool.setMaxThreadCount(5000); QString connectionStr = "Driver={PostgreSQL};Server=127.0.0.1;Port=5432;Database=AsicamtheDB;Uid=root;Pwd=ayaman;"; db.setConnectOptions(); db.setDatabaseName(connectionStr); if(db.open()) { qDebug() << "connected to database" <<endl; } else { qDebug() << "Not connected" <<endl; qDebug() << db.lastError() <<endl; qDebug() << db.drivers() <<endl; }To copy to clipboard, switch view to plain text mode
Bookmarks