Art1st
Art1st

Reputation: 123

[FireDAC][Phys][FB] file is not a valid database

I have a problem when accessing a GDB-DataBase via the FireDAC.FB-Driver. The strange thing here is, that if I set up the connection at designtime, everything works fine with

DriverID = FB

Server = 127.0.0.1

Protocol = TCPIP

If I try the same connection params at runtime however it gives me a [FireDAC][Phys][FB] file is not a valid database-Error.

Units FireDAC.Phys.FB FireDAC.Phys.FBDef are both included. I even tried to set all possible dll-Files as VendorLib, but it doesn't change anything.

I know *.GDB is usually a InterBase-DataBase, but I have a FireBird-Server running, and to my understanding access via FB-Driver should work, since it does when specifying the connection at designtime.

Firebird-Server-Version is 2.5.3.26778 32-Bit

DelphiVersion is XE7

Additional Edit: ODS of the DataBase-File is 11.2 (Firebird 2.5/InterBase 7.5)

Any ideas what I'm doing wrong?

Upvotes: 0

Views: 6951

Answers (1)

Mark Rotteveel
Mark Rotteveel

Reputation: 108971

Although InterBase and Firebird have a common heritage and share a lot of terminology, they are not the same. Since Firebird 1.5, the ODS versioning has diverged. Even though Firebird 1.5 and InterBase 6.1 both have ODS 10.1, these ODS versions are different and not compatible, more so for Firebird 2.5 and InterBase 7.5 (which both have an ODS version 11.2).

So if you try to open an InterBase 7.5 database with Firebird 2.5 it will not work and Firebird will report that the database is invalid (and vice versa InterBase will report a similar error if you try to open a Firebird database).

On a technical level this is achieved in Firebird by masking the ODS version so they are distinct from the version of InterBase:

Hds_ods_version: Two bytes, unsigned. Bytes 0x12 and 0x13 on the page. The ODS major version for the database. The format of this word is the ODS major version ANDed with the Firebird flag of 0x8000. In the example below, the value is 0x800b for ODS version 11. The minor ODS version is held elsewhere in the header page - see hdr_ods_minor below.

From: Inside a Firebird Database → Database Header Page - Type 0x01

Upvotes: 3

Related Questions