Zeos 6.6.xx (alpha) MySql 4.0 and Lazarus 0.9.22 Beta
Posted: 09.07.2007, 15:03
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
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