How to connect to a firebird database
Posted: Sat Jan 29, 2011 11:36 pm
Hello all,
My first time using ODBC, connection strings etc. I was able to get connected and work with a PostgreSQL database just fine, but cannot seem to get even a connection to a Firebird database. The ODBC drivers are installed, the Firebird tools connect etc, but after spending several hours trying within PB, cannot seem to do it. Can anyone help with some sample code?
This is what I have tried, nothing worked
On each attempt the microsoft ODBC object errors. I think part of my problem is plain confusion on how to handle the connection string. The one I found on the net, as a result of a previous post, has semi colons in it so obviously it cannot be used, "as is" from within PB since PB interprets the semis as remarks, this is why I added quotes to the line. But even with that, I am just blind to where and how to use this string.
The docs and sample does not help me either, particularly since the parameters do not appear to be the same.
If anyone can provide some sample code, I would be very grateful!
Thank you!
Tim
My first time using ODBC, connection strings etc. I was able to get connected and work with a PostgreSQL database just fine, but cannot seem to get even a connection to a Firebird database. The ODBC drivers are installed, the Firebird tools connect etc, but after spending several hours trying within PB, cannot seem to do it. Can anyone help with some sample code?
This is what I have tried, nothing worked

Code: Select all
If DB = 1 ;FB
DbID = UseODBCDatabase()
river="Firebird/InterBase(r) driver,Uid=SYSDBA,Pwd=masterkey,Dbname=C:\AxcysV10\Firebird\Data\axcys.fdb"
;Driver=Firebird/InterBase(r) driver;Uid=SYSDBA;Pwd=masterkey; Dbname=C:\AxcysV10\Firebird\Data\axcys.fdb
;Driver="{Firebird/InterBase(r) driver};Uid=SYSDBA;Pwd=masterkey; Dbname=C:\AxcysV10\Firebird\Data\axcys.fdb"
;Result = OpenDatabase(#Database, DatabaseName$, User$, Password$ [, Plugin])
; DbID=OpenDatabase(#PB_Database_ODBC, "Driver=Firebird/InterBase(r) driver,Dbname=C:\AxcysV10\Firebird\Data\AXCYS.FDB,CHARSET=NONE","SYSDBA","masterkey")
;DbID = OpenDatabase(1,"host=localhost port=3050 dbname=C:\AxcysV10\Firebird\Data\axcys.fdb","SYSDBA","masterkey",#PB_Database_ODBC)
; DbID = OpenDatabase(1,"host=localhost port=3050 dbname=C:\AxcysV10\Firebird\Data\axcys.fdb","SYSDBA","masterkey",#PB_Database_ODBC)
DbID = OpenDatabase(#PB_Any,"host=localhost port=3050 dbname=C:\AxcysV10\Firebird\Data\axcys.fdb","SYSDBA","masterkey",#PB_Database_ODBC)
EndIf
Errors = DatabaseError()
Code: Select all
Driver="Firebird/InterBase(r) driver,Uid=SYSDBA,Pwd=masterkey,Dbname=C:\AxcysV10\Firebird\Data\axcys.fdb"
If anyone can provide some sample code, I would be very grateful!
Thank you!
Tim