Page 1 of 1

Zeos 6.6.xx (alpha) MySql 4.0 and Lazarus 0.9.22 Beta

Posted: 09.07.2007, 15:03
by viemme
Hy...
I tried to create a simple query runtime
Here the code

QueryRecuperaBottoni:=TZReadOnlyQuery.Create(Self);
QueryRecuperaBottoni.Connection:= ZconnectionCassa;
QueryRecuperaBottoni.SQL.Clear;
QueryRecuperaBottoni.SQL.Add('Select Description from buttonssettings');
QueryRecuperaBottoni.Open;
QueryRecuperaBottoni.First;
RecordIndex:=1;
while QueryRecuperaBottoni.EOF = false do
begin
bottoni[recordIndex] := TButton.Create(Self);
ButtonText:= QueryRecuperaBottoni.FieldByName('Description').AsString;
with Bottoni[recordIndex] do
begin
Parent := PanelButtons;
Caption := ButtonText ;
Top := RecordIndex * Height;
Tag := recordIndex;
end;
recordIndex:= recordIndex+1;
QueryRecuperaBottoni.Next;
end;

QueryRecuperaBottoni.Close;
QueryRecuperaBottoni.Free; [/font]

this simple query must retrieve a label to write on buttons (crated runtime)
I have the zconnection set to True,the compiler run but when i arrive to tis line:
ButtonText:= QueryRecuperaBottoni.FieldByName('CodiceCassa').AsString;
the runtime fail (External: SIGSEGV)
If i don't load the button text the procedure create the buttons (open query and create the right number of buttons)

What is the problem?

Thanks
Davide

Posted: 16.07.2007, 20:14
by mdaems
Can you attach a sample program and the database creation script? It may be easier to find the bug that way...

Posted: 16.07.2007, 20:39
by viemme
There is the small project,and the query to create the buttonssetting table of my database...

I create the zconnection, set the database, and connected...
I have also problem when i create at design time a TZQuery and TDataSource with a TDBGrid, in this case lazarus fail and close itself.

Thanks a Lot for your interesting...

PS: I work with
-Windows XP SP2
-MySQL 4.0.20a
-lazarus 0.9.22-Beta

Problem old version of mySQL client???

Posted: 17.07.2007, 11:46
by viemme
Hi, I tried with the component TMysql40Connection to connect my Database and i found an error...

The TMySql40Connection can not work with the installed MySQL client Version (3.23.30-Gamma)

Is possible that problem is the problem with the ZEOS component?

I try to chage the client...If possible...I don't now how to change it, but I try..

Thanks a Lot,
if You have a response how to change the installed mySQL client...

Posted: 17.07.2007, 12:15
by mdaems
OH... that's the problem... 2 solutions
- just select the 3.23 protocol (you must enable it in zeos.inc because it's deprecated now)
- copy the 4.0 dll from the zeoslib distribution or mysql distribution next to your executable (same dir) if you still want to keep the 3.23 dll on your system path.

Ok Work...Post Closed

Posted: 17.07.2007, 13:23
by viemme
Thanks...

Now Work, I had some problem with this Old Database version 4.0, and I tried to install a new One Version of MySQL (5) and with the new clientLibrary (libMySQL50.dll) work very Fine...

I decide to upgrade the MySQL because I want this project running also on Linux, there is some porblems if I use this versions of ZEOS and Lazarus?
I think to use only the standard components...

Thanks

Davide

Posted: 17.07.2007, 13:47
by mdaems
Normally this should work fine... Certainly with newer versions of zeos and lazarus/fpc.