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
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?
Содержание
- 1 Answer 1
- Screenshot of error message:
- Precise Explanation:
- Sample Files:
1 Answer 1
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.
У меня есть проблемы при доступе к GDB-DataBase через FireDAC.FB-драйвер. Странная вещь здесь, что если установить соединение при DesignTime, все отлично работает
Если я пытаюсь тем же Params соединения во время выполнения , однако это дает мне [FireDAC][Phys][FB] file is not a valid database -ошибка.
Единицы FireDAC.Phys.FB FireDAC.Phys.FBDef оба включены. Я даже попытался установить все возможные DLL-файлы , как VendorLib , но это ничего не меняет.
Я знаю * .gdb обычно InterBase-DataBase, но у меня есть ход FireBird-сервер, и мой доступ к пониманию через FB-драйвер должен работать, так как он делает при указании соединения на DesignTime.
Firebird-Server-версии 2.5.3.26778 32-Bit
DelphiVersion является XE7
Дополнительное редактирование: ODS базы данных-файла составляет 11,2 (Firebird 2.5 / InterBase 7.5)
Любые идеи, что я делаю не так?
Хотя InterBase и Firebird имеют общее наследие и разделяют много терминологии, они не то же самое . Так как Firebird 1.5, то СОД управления версиями уже разошлись. Несмотря на то, Firebird 1.5 и InterBase 6.1 оба имеют ODS 10.1, эти версии ODS различны и не совместимы, более для Firebird 2.5 и InterBase 7.5 (которые обе имеют ОРВ версии 11.2).
Так что, если вы пытаетесь открыть базу данных InterBase 7.5 с Firebird 2.5 не будет работать и Firebird сообщит , что база данных является недействительным (и наоборот InterBase сообщит подобную ошибку , если вы пытаетесь открыть базу данных Firebird).
На техническом уровне это достигается путем маскировки Firebird версии ODS таким образом, они отличаются от версии InterBase:
Hds_ods_version Два байта без знака. Байты 0x12 и 0x13 на этой странице. ODS основная версия базы данных. Формат этого слова является ODS основной версии операции AND с Firebird флагом 0x8000. В приведенном ниже примере, значение 0x800b для ODS версии 11. Меньший СОД версия удерживается в другом месте на странице заголовка — см hdr_ods_minor ниже.
When trying to attach a .MDF database in SQL Server, you see the following error message:
Attach database failed for Server ‘xxx’. (Microsoft.SqlServer.Smo)
An exception occurred while executing a Transact-SQL statement or batch. (Microsoft.SqlServer.ConnectionInfo)
The header for file ‘xxx.mdf’ is not a valid database file header. The FILE SIZE property is incorrect.(Micosoft SQL Server, Error:5172)
where ‘xxx.mdf’ is name of the MDF file to be attached.
Screenshot of error message:
Precise Explanation:
The data in MDF file are stored as pages, each page is 8KB. The first page is called the file header page, which contains the most important information about the whole file, such as the file signature, file size, compatibility, etc.
If the MDF file header page is damaged or corrupted, and cannot be recognized by Microsoft SQL Server, then SQL Server will think the header is not valid and report this error.
You can use our product DataNumen SQL Recovery to recover the data from the corrupt MDF file and solve this error.
Sample Files:
Sample corrupt MDF files that will cause the error:
Источник: