Access violation on ZEOS lazarus / 16-Databases ---------------------------------------------------------------------- iru · 2010-04-27 21:01 Gentlefolk, Laz 0.9.28, ZEOS 6.6.6, Win XP SP-3. At design time I have a "datamodule", add a ZConnection and ZQuery. Set all the ZConnection parameters, establish the connection to the Firebird database OK. Set the parameters on the ZQuery, set the SQL, all OK. When the ZQuery "Active" parameter is set to TRUE an  "access violation" error occurs. Checked lots of things, all looks OK, have done this before with no problems.Any ideas, suggestions????? Ian ---------------------------------------------------------------------- Zoran · 2010-04-28 03:09 Please upload a smallest possible application which produces an error, together with a database script or .gbk backup file (if possible, one table, one field, one record). The smallest possible, but that you experience this error. ---------------------------------------------------------------------- Zoran · 2010-04-28 03:14 Actually, first you try your application with zeos 6.6.5 if you are using lazarus 0.9.28. ---------------------------------------------------------------------- JD · 2010-04-28 03:56 Quote from: iru on April 27, 2010, 11:01:41 pmGentlefolk, Laz 0.9.28, ZEOS 6.6.6, Win XP SP-3. At design time I have a "datamodule", add a ZConnection and ZQuery. Set all the ZConnection parameters, establish the connection to the Firebird database OK. Set the parameters on the ZQuery, set the SQL, all OK. When the ZQuery "Active" parameter is set to TRUE an  "access violation" error occurs. Checked lots of things, all looks OK, have done this before with no problems.Any ideas, suggestions????? Ian Are you using Firebird Embedded or Firebird Server? ---------------------------------------------------------------------- tonip · 2010-04-28 04:32 This is general problem with Firebird 2.1.x after Firebird-2.1.3.18185, problem exist with BDE and Delphi. I think root of problem is Microsoft.VC80 library msvc?80.dll and GDS32.DLL / fbclient.dll. ---------------------------------------------------------------------- iru · 2010-04-28 19:16 Attached is a zip of a simple test project. The database is empty, nothing in it. Program is one form, DBGrid, DataSource, ZQuery and ZConnection. ZConnection is "connected". Can see it as SYSDBA in FlameRobin>Advanced>connected-users. Set ZQuery as active and "access violation". Server is "embedded". Thanks, Ian. ---------------------------------------------------------------------- iru · 2010-04-28 19:35 A little more on this..... I have another Lazarus project on the same computer. Has a datamodule with a zconnection and multiple zquery. I can add ZQueries to it with no problems, set active = true with NO "access violation". Ian ---------------------------------------------------------------------- iru · 2010-04-28 19:50 Even more..... Set the protocol on the zconnection to 2.0 (from 2.1) no change. Set the protocol to 1.5, could set the ZQuery to ACTIVE. Set the protocol to 2.0, could set the ZQuery to ACTIVE. Set the protocol to 2.1, could set the ZQuery to ACTIVE. Ian ---------------------------------------------------------------------- iru · 2010-04-28 19:54 More and more.... After performing the change of protocol on the zconnection mentioned in the previous post I closed the project. Opened the original project, I could now set the "active" bit on the ZQuery. Looks like the change in protocol reset something, somewhere..... Ian ---------------------------------------------------------------------- iru · 2010-04-28 21:56 More and more and uglier and uglier..... I opened the original project, it has a datamodule with one zconnection and one zquery. Could set the zquery active bit. Compiled clean. Program crashes as it starts up. Stepped through startup code, crashing on      Application.CreateForm(TDM, DM);  This is the datamodule. I have no code in this module. Removed zconnection and zquery, compile and run OK. Added zconnection, connected to database, compile and run OK. Added zquery, attached it to zconnection, added sql, compile and run OK. Set zquery to ACTIVE, compile and run. Crashes in the following code (module application.inc, line 1943) at line 1960: procedure TApplication.CreateForm(InstanceClass: TComponentClass;   out Reference); var   Instance: TComponent;   ok: boolean;   AForm: TForm; begin   // Allocate the instance, without calling the constructor   Instance := TComponent(InstanceClass.NewInstance);   // set the Reference before the constructor is called, so that   // events and constructors can refer to it   TComponent(Reference) := Instance;   ok:=false;   try     if (FCreatingForm=nil) and (Instance is TForm) then       FCreatingForm:=TForm(Instance);     Instance.Create(Self); <<<<< STOPS HERE 1960 >>>>>>>>     ok:=true;   finally     if not ok then begin       TComponent(Reference) := nil;       if FCreatingForm=Instance then         FCreatingForm:=nil;     end;   end; Closed project. Quit lazarus. Restarted Lazarus, opened project, tried to set the active bit on the zquery, woops access violation again..... Help, Ian ---------------------------------------------------------------------- iru · 2010-04-28 22:08 Onwards, onwards (I think).... If I set the zconnection protocol to 1.5 I can set the zquery active. Program compiles and runs OK, I can access a table in the database.. Ian ---------------------------------------------------------------------- tonip · 2010-04-29 04:51 Set protocol to firebirdd-2.0 or firebirdd-2.1 for embeded server. In your attach save.zip protocol is firebird-2.0, this protocol is for independent firebird servers. ---------------------------------------------------------------------- Zoran · 2010-04-29 05:27 Yes, what tonip says might be the reason if you really use embedded. Notice the difference -- firebirdd-2.1 for embedded has one more "d". However, what you provide does not look as an application which connects to embedded. Furthermore, you say the database is quite empty, but it can't be, because I can see from your Query1.SQL that there must be a table named "venue_results". Of course, the query could not be opened if the table does not exist. So, I created the database "C:\Projects\test-1\TEST1DB.FDB", and in it I created the table "venue_results". As you didn't provide its definition, I used this: Code: [Select]CREATE TABLE VENUE_RESULTS (   ID Integer NOT NULL,   VRESULT Integer,   PRIMARY KEY (ID) ); And I coud not reproduce the problem... the query opens... ---------------------------------------------------------------------- iru · 2010-04-29 09:02 Interesting, I did not appreciate the differnce indicated by the extra "d". My FB server was built from "firebird-2.1.3.....". Furthermore I did not appreciate the difference in the various protocols (with and without the extra "d") on the zconnection. Need to take things a little more slowly......... I will check through my project/s and straighten things out. In the zip file I attached there was a file "test-3-empty.txt" which I thought contained the ddl for the dtabase - empty!!! Or so I thought. Thanks for the input, information, etc. Ian ---------------------------------------------------------------------- Zoran · 2010-04-29 11:33 Quote from: iru on April 29, 2010, 11:02:31 amIn the zip file I attached there was a file "test-3-empty.txt" which I thought contained the ddl for the dtabase - empty!!! Or so I thought. Yes, this file is there, but contains a completely empty database, no tables in it, just nothing. But, for your query to work, "venue_results" must be there at least. ---------------------------------------------------------------------- iru · 2010-04-29 21:59 Gentlefolk, Please humor me on this one. Following the previous replies in this forum I checked through a project and tried to get things correct with FB, FB embedded and the protocols required. Woops, up popped the access violation. So I have done the following: FB software = Firebird-2.1.3.18185-0_win32. Exited lazarus. Created a directory Re-entered lazarus. Created an application. Saved the application in the directory. Created a FB database in the directory. Added a single table to the DB. Added a zconnection to the form. As I have firebird (no extra d) selected protocol = firebird-2.0. Completed all parameters. Added zquery1. Added sql, pointed to the zconnection. Could not set active = true, got an "access violation". Set zconnection.protocol = firebird-1.5, same problem. Set zconnection.protocol = firebird-1.0, could set zquery active. Project compiled OK, executed and displayed the blank form. Exited Lazarus, re-entered, performed all the above tests (2.0, 1.5, 1.0), results the same. Back to an original project, woops zconnection.protocol - firebirdD-2.0. Wrong!!!! Changed to firebird-2.0, could set zqueries.active = true. Project compiled ok, crashed on execution. Changed zconnection.protocol = firebird-1.0. Compiled and executed OK. Set zconnection.protocol = firebirdd-2.0 compiles and executes OK. So it appears that to use FB with the "correct" (protocol without the extra d) I am limited to 'firebird-1.0' to get things to compile and execute correctly. I have attached the simple test example. Ian ---------------------------------------------------------------------- Pere · 2010-10-23 14:04 I had same problem with Laz 0.9.28, ZEOS 6.6.6, Debian 6 and Firebird 2.1.3.18185 installed from Debian repositori. I solved it replacing at /usr/lib/ libfbclient.so libfbclient.so.2 with the same libraries from Firebird 2.1.1.11791. After that no more "Access violation"