Error change the Connection of a ZQuery - MySQL

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
WillMometti
Fresh Boarder
Fresh Boarder
Posts: 5
Joined: 02.12.2013, 18:26

Error change the Connection of a ZQuery - MySQL

Post by WillMometti »

Hi,

Error (Access violation at address) to change the Connection of a ZQuery - MySQL.

Example:

   with Query
   begin
     Close;
     Connection: = Database1;
     Open;
   end;

Open properly.

But in the sequel, if I change the Connection error occurs:

   with Query
   begin
     Close;
     Connection: = Database2;
     Open;
   end;


Tested with ZEOSDBO-7.1.4-stable and ZEOSDBO-7.2.0-beta in RAD Studio XE7 with Windows 7.

In Delphi 7 with ZEOSDBO-6.6.6-stable does not occur this error.


Note: I am converting an application from Delphi 7 to XE7.


Please can someone help me?

Thank you.

:o :shock:
User avatar
EgonHugeist
Zeos Project Manager
Zeos Project Manager
Posts: 1936
Joined: 31.03.2011, 22:38

Re: Error change the Connection of a ZQuery - MySQL

Post by EgonHugeist »

Patch done: R3542 \testing-7.2 (SVN)

You need to replace this function with new code in ZAbstractRODataSet.pas:

Code: Select all

procedure TZAbstractRODataset.SetConnection(Value: TZAbstractConnection);
begin
  if FConnection <> Value then
  begin
    if Active then
       Close;
    Unprepare; <<<<----- was missing
    if FConnection <> nil then
      FConnection.UnregisterDataSet(Self);
    FConnection := Value;
    if FConnection <> nil then
      FConnection.RegisterDataSet(Self);
  end;
end;
Best regards, Michael

You want to help? http://zeoslib.sourceforge.net/viewtopic.php?f=4&t=3671
You found a (possible) bug? Use the new bugtracker dude! http://sourceforge.net/p/zeoslib/tickets/

Image
Post Reply