Work at SourceForge, help us to make it a better place! We have an immediate need for a Support Technician in our San Francisco or Denver office.

Close

Qt3. member function setDatabase

Vadik2007
2007-03-16
2013-04-08
  • Vadik2007
    Vadik2007
    2007-03-16

    No source code for this member function!

    QSqlDatabase *db;
    QPSQLDriver *drv_postgres;

    drv_postgres = new QPSQLDriver(NULL,"postgres");
    db = QSqlDatabase::addDatabase(drv_postgres,"postgres");

    report = new NCReport( QString::null, 0 );
    report->setParseMode( NCReport::fromDatabase );
    report->setDatabase(db);

    not linked!
    "error LNK2019: unresolved external symbol "__declspec(dllimport) public: void __thiscall NCReport::setDatabase(class QSqlDatabase *)" (__imp_?setDatabase@NCReport@@QAEXPAVQSqlDatabase@@@Z) referenced in function "public: __thiscall VMainForm::VMainForm(void)" (??0VMainForm@@QAE@XZ)"

     
    • Norbert Szabo
      Norbert Szabo
      2007-03-20

      Hello,

      NCReport ideally uses the default database connection, so you don't need set by report->setDatabase(db); it should work without setDatabase(...), but first you should open database using db->open(). See ncreporttestform.cpp.