field:=Trim(ComboBox1.Text);
condition:=Trim(Edit1.Text)+'%';
sqlline:='select * from 故障信息 where '+field+'
like '+''''+condition+'''';
sqltime:=' and 时间 between #'+DateToStr(D1.Date)+' '+TimeToStr(T1.Time)+'# and #'+DateToStr(D2.Date)+' '+TimeToStr(T2.Time)+'# ';
if CheckBox1.Checked then
sqlline:=sqlline+sqltime;
ADOQuery1.Close;
ADOQuery1.SQL.Text:=sqlline;
ADOQUery1.ExecSQL;
ADOQuery1.Open; 出现不正常的定义参数对象,提供了不一致或不完整的信息,我找不到出错的具体位置,希望大家帮忙呀。
condition:=Trim(Edit1.Text)+'%';
sqlline:='select * from 故障信息 where '+field+'
like '+''''+condition+'''';
sqltime:=' and 时间 between #'+DateToStr(D1.Date)+' '+TimeToStr(T1.Time)+'# and #'+DateToStr(D2.Date)+' '+TimeToStr(T2.Time)+'# ';
if CheckBox1.Checked then
sqlline:=sqlline+sqltime;
ADOQuery1.Close;
ADOQuery1.SQL.Text:=sqlline;
ADOQUery1.ExecSQL;
ADOQuery1.Open; 出现不正常的定义参数对象,提供了不一致或不完整的信息,我找不到出错的具体位置,希望大家帮忙呀。
是的话,直接使用就可以了
如下:
Format('time between ''%s'' and ''%s''',[FromTime,ToTime])
ADOQuery1.Open; 以上语句二选一!
ADOQuery1.Open; 以上语句二选一!
在ExecSql处设断点
CTRL+F7
将SQL语句贴出来!
然后让大家分析一下,
谢谢