Hi Everyone here,
I have a problem and attachement a simple project to ilustrate it.
When i create "on the fly", after post, the component inactive If i use component from form, all is OK.
Can someone advise, where's my fault?
Thanks!
procedure TForm1.FormCreate(Sender: TObject);
var
SQL1:TSQLQuery;
DTS1:TDataSource;
begin
with MySQL56Connection1 do begin
HostName:='localhost';
UserName:=''; //'user24';
Password:=''; //'2024';
DataBaseName:='db24';
Connected:=True;
end;
SQLTransaction1.Active:=True;
with SQLQuery1 do begin
SQL.Text:='select * from art';
Open;
end;
// {
// OPTION I: WORK FINE
with SQLQuery2 do begin
SQL.Text:='select * from fam order by fam_nom';
Open;
DBLookupComboBox1.ListSource:=DataSource2;
end;
// }
//
{
// OPTION II: "After update and post" component DBLookupComboBox1 "DISABLED";
with SQL1 do begin
SQL1:=TSQLQuery.Create(Self);
Database:= SQLQuery1.DataBase;
Transaction:=SQLQuery1.Transaction;
SQL.Text:='select * from fam order by fam_nom';
Open;
DTS1:=TDataSource.Create(Self);
DTS1.DataSet:=SQL1;
DBLookupComboBox1.ListSource:=DTS1;
SQL1:=nil;
DTS1:=nil;
end;
// }
end;