Recent

Author Topic: Access violation on ZEOS  (Read 25911 times)

iru

  • Sr. Member
  • ****
  • Posts: 331
Access violation on ZEOS
« on: April 27, 2010, 11:01:41 pm »
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

  • Hero Member
  • *****
  • Posts: 1988
    • http://wiki.lazarus.freepascal.org/User:Zoran
Re: Access violation on ZEOS
« Reply #1 on: April 28, 2010, 05:09:41 am »
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.
Swan, ZX Spectrum emulator https://github.com/zoran-vucenovic/swan

Zoran

  • Hero Member
  • *****
  • Posts: 1988
    • http://wiki.lazarus.freepascal.org/User:Zoran
Re: Access violation on ZEOS
« Reply #2 on: April 28, 2010, 05:14:02 am »
Actually, first you try your application with zeos 6.6.5 if you are using lazarus 0.9.28.
Swan, ZX Spectrum emulator https://github.com/zoran-vucenovic/swan

JD

  • Hero Member
  • *****
  • Posts: 1913
Re: Access violation on ZEOS
« Reply #3 on: April 28, 2010, 05:56:58 am »
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


Are you using Firebird Embedded or Firebird Server?
Linux Mint - Lazarus 4.6/FPC 3.2.2,
Windows - Lazarus 4.6/FPC 3.2.2

mORMot 2, PostgreSQL & MariaDB.

tonip

  • Newbie
  • Posts: 2
Re: Access violation on ZEOS
« Reply #4 on: April 28, 2010, 06:32:31 am »
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

  • Sr. Member
  • ****
  • Posts: 331
Re: Access violation on ZEOS
« Reply #5 on: April 28, 2010, 09:16:52 pm »
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

  • Sr. Member
  • ****
  • Posts: 331
Re: Access violation on ZEOS
« Reply #6 on: April 28, 2010, 09:35:55 pm »
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

  • Sr. Member
  • ****
  • Posts: 331
Re: Access violation on ZEOS
« Reply #7 on: April 28, 2010, 09:50:03 pm »
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

  • Sr. Member
  • ****
  • Posts: 331
Re: Access violation on ZEOS
« Reply #8 on: April 28, 2010, 09:54:52 pm »
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

  • Sr. Member
  • ****
  • Posts: 331
Re: Access violation on ZEOS
« Reply #9 on: April 28, 2010, 11:56:10 pm »
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

  • Sr. Member
  • ****
  • Posts: 331
Re: Access violation on ZEOS
« Reply #10 on: April 29, 2010, 12:08:04 am »
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

  • Newbie
  • Posts: 2
Re: Access violation on ZEOS
« Reply #11 on: April 29, 2010, 06:51:14 am »
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

  • Hero Member
  • *****
  • Posts: 1988
    • http://wiki.lazarus.freepascal.org/User:Zoran
Re: Access violation on ZEOS
« Reply #12 on: April 29, 2010, 07:27:11 am »
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...
Swan, ZX Spectrum emulator https://github.com/zoran-vucenovic/swan

iru

  • Sr. Member
  • ****
  • Posts: 331
Re: Access violation on ZEOS
« Reply #13 on: April 29, 2010, 11:02:31 am »
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

  • Hero Member
  • *****
  • Posts: 1988
    • http://wiki.lazarus.freepascal.org/User:Zoran
Re: Access violation on ZEOS
« Reply #14 on: April 29, 2010, 01:33:14 pm »
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.

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.
Swan, ZX Spectrum emulator https://github.com/zoran-vucenovic/swan

 

TinyPortal © 2005-2018