Page 1 of 1

6.6.1 Delphi 6 MySql 5

Posted: 03.03.2007, 19:01
by jkebert
Several things....

In Delphi 6, the .pas files will not compile until I edited every file so that the Include directive eg.{$I ZCore.inc} is after the "uses" statement. Here is what the beginning of ZClasses.pas looks like now:

unit ZClasses;

interface

uses
SysUtils, Classes;

{$I ZCore.inc}

const
ZEOS_VERSION = '6.6.1 - beta';

.......

After doing that for all the .pas files everything compiled properly and I was able to install the components.

Now the problem that I still have...I cannot connect to MySQL 5.0.27.
I always get the "Requested database driver not found" message when I try to change the ZConnect property "connected" to true.

ZConnect "protocol" is mysql
host is localhost (also tried my IP Address)
port 3306
user root
password (mypassword)
database test (as I know it exists)

I have placed libmySql.dll from the MySQL 5 in my windows\system32 directory and in the exe directory.

I have tried libmySQL50.dll as well in both those places...still no joy.
I also tried renaming them to libmysql.dll.

Interestingly, when I try the "simple" example it works??

Any suggestions other than that I must be daft.

Best regards,

John

Posted: 04.03.2007, 09:14
by mdaems
Well,

At least it is strange.

Did somebody else have this include problem with D6 or knows what the reason can be?
I tried Lazarus, D5, D7, D2006 and none of them had this problem.

The 'driver not found' problem has to do with the dll not being found. If the 'Simple' example works it means your DLL is in the right place. The sample program creates the connection at runtime.
I suppose this problem shows when you set the connected property to true in the IDE? So you may have a problem with the paths the IDE uses. Can you try to set the connected property to true at runtime (formCreate or a button for example)? I guess it works fine then.
Unfortunately I have no idea about the design time solution. I don't know much about the Delphi internals. (may be related to your include problem as well)

Mark

Posted: 11.03.2007, 05:59
by jkebert
Thanks Mark,

It does work fine when the connected property is set to true in a buttonclick procedure, which will be okay, although sometimes it is nice to set it true in the IDE for layout purposes, but not a show stopper.

I have tried various path adjustments in the IDE with no luck - oh well.

Best regards,

John

Posted: 11.03.2007, 22:08
by jkebert
Hi Again,

Well, it *is* a show stopper, as I cannot load my field defs into the component to format or hide various fields... grrr.

John