procedure TForm1.CheckBox1Click(Sender: TObject);
begin
if (CheckBox1.Checked) then
begin
ADOQuery2.Active:=true;
with ADOQuery2 do
begin
Close;
SQL.Clear;
SQL.Add('select measuretime as 时间,ultraviolet as 紫外 from nongdu2 where measuretime between :p andv :q');
ADOQuery2.Parameters.ParamByName('p').Value:=DateTimePicker1.Date;
ADOQuery2.Parameters.ParamByName('q').Value:=DateTimePicker2.Date;
ADOquery2.Prepared;
Open;
end;
Series1.XLabelsSource:='时间';
Series1.YValues.Valuesource:='紫外';
Series1.DataSource:=ADOQuery2;
end
else
ADOQuery2.Active:=false;
end;
请帮我看一下这段代码有无错误,编译时是没有错误的,但是就是出不来结果。
------解决方案--------------------------------------------------------
这个你只能自己检查条件是否符合了,字段的值,是否符合你参数的形式