MySQL and DLL's

Forum related to MySQL

Moderators: gto, cipto_kh, EgonHugeist

Post Reply
ClassicGlory
Fresh Boarder
Fresh Boarder
Posts: 3
Joined: 21.10.2005, 16:13
Location: UK
Contact:

MySQL and DLL's

Post by ClassicGlory »

Is it possible to embed the libmysql40.dll in an exe using Delphi 5?

When I create a program is seems to require this dll even though my database is MySQl 3.23.
Most of the host PC's have libmysql.dll loaded but the program requires libmysql40.dll... is this changeable?

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

Post by mdaems »

Are you sure the protocol of the Connection component is set to mysql323 at the moment you open the connection? (If you connect using code : debug point on the open command or active:=true line)

If that's alright and it requires 40.dll there's something wrong. What zeos version are you using?

You can try to modify Zeos.inc in the sources directory by commenting out strict dll_loading:

Code: Select all

// Prevents loading default libmysql.dll
{.$DEFINE MYSQL_STRICT_DLL_LOADING}
This has the risk that a wrong Dll is loaded when the host PC has a different default dll. (eg mysql 5.1 instead of 4.0)

Mark
ClassicGlory
Fresh Boarder
Fresh Boarder
Posts: 3
Joined: 21.10.2005, 16:13
Location: UK
Contact:

MySQL and DLL's

Post by ClassicGlory »

It is currently set to just mysql rather than one of the version specific MySql options. I assumed this would use the default dll rather than pick a version specific one like libmysql40.dll.
I will change this to mysql323 and see if it cures the problem, however I would still like to know if it is possible to embed the dll into the exe and save the hassle on any other non mysql 3.23 hosts.

Thanks for the quick reply.
User avatar
mdaems
Zeos Project Manager
Zeos Project Manager
Posts: 2766
Joined: 20.09.2005, 15:28
Location: Brussels, Belgium
Contact:

Post by mdaems »

Hi,
I hope it will work using mysql323.
I started a little 'to look at later' list, some minutes ago. I think it would be nice to check the actual library version in case someone just says 'mysql'. Depending on the result we could just swap to the right internal ZEOS driver. It will probably not be for this release, I think.

Concerning the embedding of the DLL, are you sure that's a good idea? If you manage to do so, you can disable all other databases (except for mysql, of course) by editing ZEOS.inc. That way you don't include code for other drivers.

I'm not an expert in this issues, but make sure it's legal to include the mysql library in your exe.

Mark
Post Reply