Home > Back-end >  Conditional statement: if the database table "ABC" TEdit1 control content is contained in
Conditional statement: if the database table "ABC" TEdit1 control content is contained in

Time:10-12

Database table name "ABC",
The database has three columns:
1) if the first column (" king0 "in a number of records and Edit1 controls in the content is consistent, so Edit5. Visible:=true; Edit6. Visible:=true,
2) if the second column in the "king1" in a number of records and Edit1 controls content is consistent, so Edit7. Visible:=true; Edit8. Visible:=true,
3) if the column "king2" in a number of records and Edit1 controls in the content is consistent, so Edit9. Visible:=true; Edit10. Visible:=true,
Can you tell me how to write?

CodePudding user response:

 
With adoquery1 do begin
The close;
SQL. The Clear;
SQL. Text:='select * from ABC where king0=: Et1';
The Parameters. ParamByName (' Et1). The Value:=Trim (Edit1. Text);
The open;
If RecordCount & gt; 0 then the begin
Edit5. Visible:=True;
Edit6. Visible:=True;
end;

The close;
SQL. The Clear;
SQL. Text:='select * from ABC where king1=: Et1';
The Parameters. ParamByName (' Et1). The Value:=Trim (Edit1. Text);
The open;
If RecordCount & gt; 0 then the begin
Edit7. Visible:=True;
Edit8. Visible:=True;
end;

The close;
SQL. The Clear;
SQL. Text:='select * from ABC where king2=: Et1';
The Parameters. ParamByName (' Et1). The Value:=Trim (Edit1. Text);
The open;
If RecordCount & gt; 0 then the begin
Edit9. Visible:=True;
Edit10. Visible:=True;
end;
end;
  • Related