Page 1 of 1

MyAccess in dll error

Posted: Sun 03 Jan 2010 18:30
by Iskren
Hello,
I create application witch Delphi 2009 and MyDAC 5.90. My application load dynamically dll library. When I use MyAccess in dll my application crash when I unload library (freeLibrary). If I remove MyAccess from dll everything work fine.

This is example of crash code:

DLL:

Code: Select all

library lib;
uses
  SysUtils,
  Classes,
  MyAccess;

{$R *.res}

begin
end.
Application:

Code: Select all

procedure TForm2.Button1Click(Sender: TObject);
var
  dllHandle: THandle;
begin

    dllHandle := loadLibrary('lib.dll');
    freeLibrary(dllHandle);

end;
Try to click 2 times button1. Application will crash.
I remove all other function from dll and application to be sure the problem is in MyAccess.
This crash when I use Lazarus too.

Sorry for my bad english.

Posted: Mon 04 Jan 2010 09:16
by Dimon
I can not reproduce the problem. Please, try to download the latest MyDAC build (5.90.0.54) and check if this problem still exists.

Posted: Mon 04 Jan 2010 10:15
by Iskren
You can download sample here: download

Please run Project1.exe and click button1 2 times. When you click second time program will crash. The source code is included in zip file.
Maybe the problem is because I use trial version, but I must to be sure before I buy it.

Posted: Mon 04 Jan 2010 13:44
by Dimon
This problem is connected with using MyDAC Trial Edition. To solve the problem you should use a non-trial MyDAC version.

Posted: Mon 04 Jan 2010 13:47
by Iskren
10x Dimon. I will buy it.

Posted: Mon 04 Jan 2010 14:53
by Dimon
If any other questions come up, please contact me.