qt-interest@trolltech.com
[Top] [All Lists]

Re: Connection to embedded firebird

Subject: Re: Connection to embedded firebird
From: Phong Mai
Date: Thu, 08 Dec 2005 08:47:55 +1100
kai.jaensch@xxxxxx wrote:
Hello,

I want to connect my Qt application to an embedded firebird database.
I put all firebird stuff in the folder of the compiled application.
In the following is the code with which I tried to connect. What am I doing wrong?
Can anybody correct my code or send me an example?

QSqlDatabase db = QSqlDatabase::addDatabase("QIBASE");
// the firebird documentation says that the host doesnÂt to be named
// db.setHostName("mars");
db.setDatabaseName("C:\opencue.fdb");
// db.setDatabaseName("DRIVER={Firebird/Interbase(r) Driver (*.fdb)}FIL={};DBQ=C:\opencue.fdb);
db.setUserName("SYSDBA");
db.setPassword("masterkey");

Thanks a lot

Kai

Hi Kai,

I have been able to connect to  the embedded fb by:

sqlDatabase = QSqlDatabase::addDatabase("QIBASE");
sqlDatabase.setDatabaseName("database.fdb");
sqlDatabase.setUserName("SYSDBA");
sqlDatabase.setPassword("password");
sqlDatabase.setPort(0);
if( !sqlDatabase.open() )
{
        qFatal("Failed to open database %s", qPrintable(pDatabase));
}

This is of course you have the QIBASE driver compiled and the firebird dll is in the directory of the data file.

--
To unsubscribe - send a mail to qt-interest-request@xxxxxxxxxxxxx with 
"unsubscribe" in the subject or the body.
List archive and information: http://lists.trolltech.com/qt-interest/

<Prev in Thread] Current Thread [Next in Thread>