Can't open old database with Firebird 1.5-2.1

The forum for ZeosLib 7.2 Report problems. Ask for help, post proposals for the new version and Zeoslib 7.2 features here. This is a forum that will be edited once the 7.2.x version goes into RC/stable!!

My personal intention for 7.2 is to speed up the internals as optimal a possible for all IDE's. Hope you can help?! Have fun with testing 7.2
Post Reply
MN7
Fresh Boarder
Fresh Boarder
Posts: 5
Joined: 09.09.2019, 11:11

Can't open old database with Firebird 1.5-2.1

Post by MN7 »

Zeos can't open old database with old Firebird (2.0 for example).
Tables can be acquired with ZConnection.GetTableNames. But next Zeos can't get data with ZQuery or ZTable: raise EZSQLException:

SQL Error: Dynamic SQL ErrorSQL error code = -206Column unknownB.RDB$FIELD_PRECISIONAt line 1, column 249. Error Code: -206. Column does not belong to referenced table The SQL: SELECT a.RDB$RELATION_NAME, a.RDB$FIELD_NAME, a.RDB$FIELD_POSITION, a.RDB$NULL_FLAG, a.RDB$DEFAULT_VALUE, b.RDB$FIELD_LENGTH, b.RDB$FIELD_SCALE, c.RDB$TYPE_NAME, b.RDB$FIELD_TYPE, b.RDB$FIELD_SUB_TYPE, b.RDB$DESCRIPTION, b.RDB$CHARACTER_LENGTH, b.RDB$FIELD_PRECISION, a.RDB$DEFAULT_SOURCE, b.RDB$DEFAULT_SOURCE as RDB$DEFAULT_SOURCE_DOMAIN,b.RDB$COMPUTED_SOURCE , b.RDB$CHARACTER_SET_ID FROM RDB$RELATION_FIELDS a JOIN RDB$FIELDS b ON (b.RDB$FIELD_NAME = a.RDB$FIELD_SOURCE) LEFT JOIN RDB$TYPES c ON (b.RDB$FIELD_TYPE = c.RDB$TYPE and c.RDB$FIELD_NAME = 'RDB$FIELD_TYPE') WHERE 1=1 AND a.RDB$RELATION_NAME = 'CUSTOMER' ORDER BY a.RDB$RELATION_NAME, a.RDB$FIELD_POSITION;
marsupilami
Platinum Boarder
Platinum Boarder
Posts: 1939
Joined: 17.01.2011, 14:17

Re: Can't open old database with Firebird 1.5-2.1

Post by marsupilami »

Hello,

Zeos tries to query data about the CUSTOMER table in your database. Firebird fails to read the field RDB$FIELD_PRECISION. This field is used to store information about numeric and and decimal data types.

Given that information the query should work on all Firebird and Interbase versions. I tested that it runs correctly on Firebird 2.0. Maybe your database is corrupted?

Best regards,

Jan
MN7
Fresh Boarder
Fresh Boarder
Posts: 5
Joined: 09.09.2019, 11:11

Re: Can't open old database with Firebird 1.5-2.1

Post by MN7 »

I'm use embedded dll (x86).

My DB is test DB from book about Delphi 7.
My code was 'ZConnection.HostName := 'localhost';'. When I change HostName to '' (empty) Zeos can open that DB. (FB 1.5 and 2.1 tested).

But.
My second DB is test DB from book about Delphi 5. And Zeos raise same error! Changing HostName not help.

Any other parameters I can try to set?
Post Reply