Connecting to non-registered odb embedded firebird databases

Good Morning,

I believe I once saw some code where a connection to a non-registered database was made using two parameters:

o The full path of the odb file
o the constant string “sdbc.embedded.firebirdsql” (this is probably NOT the correct value)

Using these two parameters the connection can be made. If anyone can help with that code that would be greatly appreciated.

Thank you.

You are looking for macro code to connect? Has nothing to do with embedded Firebird or any (to the odb-file) connected database:

DIM oDatabaseContext AS OBJECT
DIM oDatasource AS OBJECT
DIM oConnection AS OBJECT
oDatabaseContext = createUnoService("com.sun.star.sdb.DatabaseContext")
oDatasource = oDatabaseContext.getByName("registered Name of Database")
oConnection = oDatasource.GetConnection("","")

Instead of the registered name you could set

oDatasource = oDatabaseContext.getByName("file:///home/user/…/Database.odb")
1 Like