Runtime Error 216 on Program Shutdown on Delphi 2006 (10)

Forum related to version 6.5.1 (alpha) and 6.6.x (beta) of ZeosLib's DBOs

Moderators: gto, cipto_kh, EgonHugeist

MZmuda
Junior Boarder
Junior Boarder
Posts: 27
Joined: 03.09.2006, 13:15
Location: Long Island, NY, USA

Runtime Error 216 on Program Shutdown on Delphi 2006 (10)

Post by MZmuda »

Hello,

Has anybody had any experience with the ZeosLib component generating either a runtime error 216 or an access violation upon shutdown of their program while using Delphi 2006? If so, what steps were taken to correct the problem?

Thanks -

Mike Z.
User avatar
dhongu
Junior Boarder
Junior Boarder
Posts: 37
Joined: 28.09.2005, 08:37
Location: Bucuresti
Contact:

Post by dhongu »

In unit ZPlainMySql40

[syntax="delphi"]
destructor TZMySQLNativeLibraryLoader.Destroy;
begin
if Loaded then
api_rec.mysql_server_end;
inherited Destroy;
end;

[/syntax]

In this case anytime is call api_rec.mysql_server_end, but this function is for embedded server library.
Dorin Hongu
User avatar
mdaems
Zeos Project Manager
Zeos Project Manager
Posts: 2766
Joined: 20.09.2005, 15:28
Location: Brussels, Belgium
Contact:

Post by mdaems »

Can you change this code a little, compile and reinstall the components?

[syntax="delphi"]
destructor TZMySQLNativeLibraryLoader.Destroy;
begin
if Loaded
--> and @MYSQL_API.mysql_server_end <> nil then
api_rec.mysql_server_end;
inherited Destroy;
end;

[/syntax]

If this works for you I'll add it to all drivers calling this function. In theory this function should be present in als 4.0+ versions of mysql, but apparently it is not. Mysql doc <-> reallity difference? Anyway, we're better prepared.

Do you keep in touch?

Mark
MZmuda
Junior Boarder
Junior Boarder
Posts: 27
Joined: 03.09.2006, 13:15
Location: Long Island, NY, USA

Post by MZmuda »

Hello, Mark,

I'm not 100% sure if I did this right:

I opened ZPlainMySql40.pas and added the ..."and @MYSQL..." line in the destructor as you mentioned. I then saved the file.

I then reopened ZPlain.dpk, recompiled / rebuilt it. Finally, I opened ZComponent.dpk and INSTALLED it.

I then tried to create a simple application - a ZConnection, a ZTable, a DataSource, and a DBGrid. After entering my mySQL login information into the Object Inspector and setting the Connected property to true, I received an access violation error (00000000).

I also noticed that there is no mySQL version 5 drivers included? Is that correct?

Thanks -

Mike Z.
User avatar
mdaems
Zeos Project Manager
Zeos Project Manager
Posts: 2766
Joined: 20.09.2005, 15:28
Location: Brussels, Belgium
Contact:

Post by mdaems »

That's strange... What ZEOS version are you using right now? One of my distributions?
As far as I know there 's a mysql5 and mysqld5(embedded) driver included in the package. (not dll, take those from your mysql distribution and rename to myql50)
You should be able to choose mysql5 as protocol for a TZConnection component.
Also make sure there's no old mysql or mysql50 dll hanging around in your path. It could be in windows\system32. The dll used in the ide can be different from the one used when you doubleclick the exe. The IDE uses what is in his path and the project exe first checks his own directory. (first for mysql50 and there after for mysql)

About compile and install method. I usually compile every project in this sequence:
core, parsesql,plain,dbc,component. After that I install the components.
Works easiest if you open the projectgroup and click 'compiler all from here' on the core project in Delphi7.

Did you do the change in PlainMysql40,PlainMysql41 and PlainMysql5? Did you explictly choose a protocol with a version in the name (instead of the generic 'mysql').

Mark
MZmuda
Junior Boarder
Junior Boarder
Posts: 27
Joined: 03.09.2006, 13:15
Location: Long Island, NY, USA

Post by MZmuda »

Hi, Mark,

Yes - I was referring to the dlls. (I couldn't find the MySQL5 dll.) I will get one of those from my other computer and try the program again later and let you know what I find.

I am using the ZEOS_TESTING_REV_64.zip file from http://users.telenet.be/mdaems . (downloaded four nights ago.)

I did a systemwide scan for mysql*.dll. The only ones I found resided in the C:\windows, ..\system, and ..\system32 directories (as well as the ones in the library directory.) They are all clones of one another.

I don't know if I even **HAVE** a "compile all from here" option. (I'm using Delphi 2006, and have been for only about a week now, so I'm still a total newbie at it... but I'm getting a lot of practice compiling, building, and installing! :) )

I actually went ahead and changed ZPlainMySQL(5, 40, 41,320, and 323).pas to reflect the change in code.

The protocols I tried were:

mysql-4.0 (Access Violation Error (00000000))
mysql-4.1 (Access Violation Error (00000000))
mysql-5 (None of the dynamic libraries can be found (libmysql5.dll, libmysql.dll.))

The MySQL5 error can be "rectified" by getting the DLL, which I'll do later today. The other (4.0 and 4.1) dlls do exist in my windows directories / paths, but are resulting in the AVerrors.

I will have to try this on my other system (I have three build systems set up right now. None of them work. Two have Delphi 6 and 2006, one has just Delphi 2006. [The fact that Delphi 6 had some directories in the path statement caused some problems early on, hence the clean system...] All systems are running Windows XP Home or Media Center Edition. NO -Pro.)

I'm a bit perplexed, but am anxious to get this component back up and running - it's worked great for me so far in Delphi 6, so I know it's good stuff.

Thanks again for your help!

- Mike Z.
MZmuda
Junior Boarder
Junior Boarder
Posts: 27
Joined: 03.09.2006, 13:15
Location: Long Island, NY, USA

Post by MZmuda »

Hi, Mark,

What is the size of your libmysql5.dll? (Also, is it libmysql5 or libmysql50?)

Thanks -

Mike Z.
User avatar
mdaems
Zeos Project Manager
Zeos Project Manager
Posts: 2766
Joined: 20.09.2005, 15:28
Location: Brussels, Belgium
Contact:

Post by mdaems »

1.519.616 bytes. It's called libmysql.dll in mysql distribution. Just copy and rename it to what the zplainmysqldriver.pas file says.

Mark
MZmuda
Junior Boarder
Junior Boarder
Posts: 27
Joined: 03.09.2006, 13:15
Location: Long Island, NY, USA

Post by MZmuda »

Ok, Mark,

That's what I have.

Have you guys been able to test ZeosLib with a release version of Delphi 2006? I've been trying all weekend and still can't get a simple program with the component to work.

At design time, the component will connect to my server, get the data, pass it to the grid I have on my form (via the data source...) and everything looks good.

When I try to compile, the system fails on line 529 - {$I ZPlainMysql.inc} with the error "File not Found." (The .inc file exists, only it's inaccessible while Delphi is open - Once I exit out of Delphi [and I assume all of the file handles are released,] I can open the file.) (both when the component is connected or not connected during design-time.)

Any ideas why this is happening?

- Mike Z
User avatar
dhongu
Junior Boarder
Junior Boarder
Posts: 37
Joined: 28.09.2005, 08:37
Location: Bucuresti
Contact:

Post by dhongu »

I am tested ZeosLib with Delphi10 and work fine.
Try to add path to source component to Delphi in Library Path.
Dorin Hongu
MZmuda
Junior Boarder
Junior Boarder
Posts: 27
Joined: 03.09.2006, 13:15
Location: Long Island, NY, USA

Post by MZmuda »

Hi, Dorin,

The path is there. When Delphi is open, the ZPlainMysql.inc file cannot be opened by any means. It cannot be copied or opened in Notepad. When Delphi closes, the file can be copied, opened in notepad, deleted, etc... The file is DEFINITELY in the library path, though - that I've checked a number of times.

- Mike Zmuda.
MZmuda
Junior Boarder
Junior Boarder
Posts: 27
Joined: 03.09.2006, 13:15
Location: Long Island, NY, USA

Post by MZmuda »

Dorin,

What version (build) of Delphi X are you using?

Thanks -

Mike Zmuda.
User avatar
dhongu
Junior Boarder
Junior Boarder
Posts: 37
Joined: 28.09.2005, 08:37
Location: Bucuresti
Contact:

Post by dhongu »

MZmuda, Delphi 10.0.2166.28377
Dorin Hongu
MZmuda
Junior Boarder
Junior Boarder
Posts: 27
Joined: 03.09.2006, 13:15
Location: Long Island, NY, USA

Post by MZmuda »

Hello, All,

I have just gone ahead and purchased a new computer system to begin a fresh, totally new install of the component. (yes - I just bought a new computer just to get this component to work.)

I've reinstalled Delphi 2006 - There is no Delphi 6 on this system.

With this in mind, can someone give me detailed instructions to install the ZeosLib for Delphi 10? Which file do I choose from http://users.telenet.be/mdaems? What do I click / where?

I know this is a bit drastic, but I'm taking drastic steps to making sure this component installs, so I can get my program working again.

I know I sound pathetic, but please help!

Thanks -

Mike Z.
User avatar
dhongu
Junior Boarder
Junior Boarder
Posts: 37
Joined: 28.09.2005, 08:37
Location: Bucuresti
Contact:

Post by dhongu »

Try with source from svn://firmos.at/zeos/branches/testing
Dorin Hongu
Post Reply