在下初学delphi,遇到了以下问题!一运行就报错.请专家们帮我看看!!!!!!
procedure TForm1.Button3Click(Sender: TObject);
begin
adoquery1.Close;
adoquery1.SQL.Clear;
adoquery1.sql.add(' select *');
adoquery1.sql.add(' from zysb');
adoquery1.sql.add('where str(使用日期)>='+#39+datetostr(DateTimePicker1.date)+#39+' and str(使用日期)<='+#39+datetostr(DateTimePicker2.date)+#39);
if trim(edit1.Text)<>'' then
adoquery1.sql.add('and zysb.设备名称 like %'''+trim(edit1.text)+'''%');
if trim(combobox1.text)<>'' then
adoquery1.sql.add('and zysb.科室名称 like %'''+trim(combobox1.text)+'''%');
adoquery1.Open;
end;