关于TDBChart的问题(附源代码)(200分)

  • 主题发起人 fanhongwei
  • 开始时间
F

fanhongwei

Unregistered / Unconfirmed
GUEST, unregistred user!
这是我的代码。请大家帮帮忙
执行第一次可以画出曲线,
把MSQL中的字段修改以后,比如将‘S10S’换成其他的字段就不行了。
具体如下:执行Button13Click以后,不能执行Button14Click。
procedure TForm3.Button13Click(Sender: TObject);
var
mSQL: string;
begin
mSQL := 'select ScanTime,S10S from onehourValue where DetectorName=''VD01'' and scantime between ''2001-12-01 16:02:34'' and ''2001-12-03 16:02:34'' order by scantime';
with DataModule4 do
if Database1.Connected then
begin
Query2.Close;
Query2.SQL.Clear;
Query2.SQL.Add(mSQL);
Query2.Open;
Series2.YValues.ValueSource:='S10S';
Series2.XLabelsSource:='ScanTime';
end;
end;

procedure TForm3.Button14Click(Sender: TObject);
var
mSQL: string;
begin
mSQL := 'select ScanTime,S10O from onehourValue where DetectorName=''VD01'' and scantime between ''2001-12-01 16:02:34'' and ''2001-12-03 16:02:34'' order by scantime';
with DataModule4 do
if Database1.Connected then
begin
Query2.Close;
Query2.SQL.Clear;
Query2.SQL.Add(mSQL);
Query2.Open;
Series2.
Series2.YValues.ValueSource:='S10O';
Series2.XLabelsSource:='ScanTime';
end;
end;
 
你的s100是什么类型的字段?
 
为什么我看不到别人的回复
 
我使用的字段是字符串
 
我使用的情况是:类似的情况不能使用Query,应该使用Table。先在数据库中为每条曲线
建立一张数据表,然后将曲线通过Table和数据表相关联即可,缺点是比较慢。[:)]
 
接受答案了
 
顶部