Page 1 of 1

MySQL and DLL's

Posted: 28.04.2006, 11:35
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...

Posted: 28.04.2006, 12:06
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

MySQL and DLL's

Posted: 28.04.2006, 12:15
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.

Posted: 28.04.2006, 22:05
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