Page 1 of 1
Delphi7 + Firebird2 Embedded + ZEOS6.6.5 Stable
Posted: 30.11.2009, 03:51
by samenglish
Delphi 7 + Firebird 2.0 Embedded + ZEOS 6.6.5
I have an existing FDB created using a SYSDBA account on another PC that has FB 1.5 Classic Server installed. I want to use this FDB.
I connect using protocol firebirdd-2.0. Host is blank. Database is full path.
If I use user='SYSDBA' and password='masterkey' I get Access Violation when I try to make ZQuery1.Active = True
If I use user=' ' (Space) and password=' ' (Space) I get 'this user does not have permission to perform this operation on this object'
The query is a simple 'select * from table_name'.
ZQuery1.ExecSQL doesn't raise an exception, but ZQuery1.Open raises the above exceptions depending on the credentials used to Connect.
I have many ideas to try to solve this one way or the other, but I wonder what anybody else thinks is the most likely cause of the problem and how they would solve it.
Much appreciated.
Posted: 30.11.2009, 13:34
by seawolf
Sorry but I don't understand:
Do you want to use a fb 1.5 with the firebirdd-2.0?
To be honest I've never tried it but the ods structure is different and you could have several errors .. Can you try doing a buckup copy (with fb 1.5) and after a restore copy (with fb 2.0), then try one more time to connect?
Posted: 01.12.2009, 00:15
by samenglish
Thanks for your reply seawolf.
you mean the structure of the database file has actually changed? I thought newer versions of FB simplly had more/better functionality in their libraries, I didn't consider that the fdb file structure itself would change significantly.
I'll take this into account next time.
Since Strict_Dll_Naming is turned On, I keep getting "Requested driver not found" when I change protocols. Could you please tell me which file(s) in the ZEOS library will reveal to me which dll files are needed for different ZConnection.Protocol values? I need to get on top of this before I can progress further with my original question.
Thank you for sharing your expertise.
Posted: 02.12.2009, 09:54
by samenglish
I found those answers by tracing the code through the ZEOS source code.
Even though I use ZConnection.Protocol="firebirdd2.1" all I needed was "fbclient.dll" in the project\bin folder and "fbclientd.dll" in \windows\system32. A tiny bit inconsistent but it doesn't matter now. Thank you and Merry Christmas.
also refer to
http://www.experts-exchange.com/Program ... #a25950100 for more details about my issues and how I resolved them
Posted: 02.12.2009, 09:56
by samenglish
Actually, not everyone subscribes to that website and I wrote the content I'm refering to so here's a copy
=============================
First of all, there were errors in my code.
(1) The Access Violation was happening because I tried to ZQuery.Open before I had connected successfully. The way I was checking the connection status was wrong.
(2) Read/Access Permission to the tables in the existing database could not be acheived unless I connected using the same credentials that created that FDB. Those users are found in the RDB$USER_PRIVILEGES system table of that database. With Firebird Embedded you can connect with any user and password but whether you can read/write to the database objects (eg. tables) through that connection is still subject to the SQL privileges assigned to the logged on user.
(3) There were no problems accessing a Firebird1.5 database using Firebird 2.1 Embedded.
(4) To connect at design-time using the "firebirdd-2.1" protocol, I copied fbembed.dll to \Program Files\Borland\Delphi7\Bin\fbclient.dll
But if I changed the protocol I would get an error and could reconnect even if I changed it back unless I restarted the Delphi IDE.
(5) To connect at run-time using the "firebirdd-2.1" protocol, I needed to copy the fbembed.dll to \WINDOWS\SYSTEM32\fbclientd.dll (1. Note changed filename; 2. I did not have to register that dll with REGSVR32.EXE). I also needed to rename fbembed.dll to fbclient.dll in the project's output folder (eg. \ProjectFolder\bin in my case because I use a bin subfolder for program output; ie. in the same folder where the exe is built). Also needed in the project output folder is icudt30.dll, icuin30.dll, icuuc30.dll (straight copy from the Firebird 2.1 Embedded install folder) although I copied all of the files from the install directory).