用Delphi,在前台利用输入参数(属性名),对后台sql表查询后,
能否对记录做如下处理:对记录中某个属性值进行分析,比如说,对得到的一条记录中,如果,年龄<25,则弹出一个对话框a,如果年龄>40,则弹出对话框b,
这个代码要如何编写,是否因为是利用动态查询,调用一个存储过程方便些~~~
请高手指教~谢谢```
能否对记录做如下处理:对记录中某个属性值进行分析,比如说,对得到的一条记录中,如果,年龄<25,则弹出一个对话框a,如果年龄>40,则弹出对话框b,
这个代码要如何编写,是否因为是利用动态查询,调用一个存储过程方便些~~~
请高手指教~谢谢```
begin
FrmADialog := TFrmADiaglog.create(Application);
try
FrmADialog.showmodal;
finally
FrmAialog.free;
end
else if query1.fieldbyname('年龄').AsInteger<25 then
begin
FrmBDialog := TFrmBDiaglog.create(Application);
try
FrmBDialog.showmodal;
finally
FrmBDialog.free;
end;
//
//首先做好2个对话框的窗体,然后引用。
if query1.fieldbyname('年龄').AsInteger<25 then
begin
FrmADialog := TFrmADiaglog.create(Application);
try
FrmADialog.showmodal;
finally
FrmAialog.free;
end;
end
else if query1.fieldbyname('年龄').AsInteger<25 then
begin
FrmBDialog := TFrmBDiaglog.create(Application);
try
FrmBDialog.showmodal;
finally
FrmBDialog.free;
end;
end;
//
if adoquery1.fieldbyname('age').asinteger<25 then
showmessage('<25');
showmessage.....
if strtofloat(edit1.text)<20 then
showmessage......