请大家帮我看一段代码
我写了这样的一个查询窗体,(注:combobox1中的值为bookin表中的几个字段)
我现在想实现,当我从combobox1中选择一个字段,然后再在edit1中输入内容
单击"确定"按钮来查询想要找的内容,然后把查询到的内容在dbgrid中显示,
以下写的代码也不知道那里有问题
请指导,谢谢!
with dm.query2 do
begin
close;
sql.Clear;
sql.Add('select * from bookin where combobox1.text=:E');
Parameters.ParamByName('E').Value:=trim(edit1.Text);
prepared:=true;
open;
end;