将access数据库数据赋给数据????????
下面是我将数据库中的值赋给数组,并相减侯在dbchart上显示的图形代码】在编译时没有错误,运行也能出结果,但是弹出提示框,invalid pointer operation错误
望各位高手能给修改一下。不胜感激
type myarray=array of integer;
procedure TForm1.Button1Click(Sender: TObject);
var
j,i:integer;
array2,array1:myarray;
begin
setlength(array2,adodataset1.RecordCount);
setlength(array1,adodataset1.RecordCount);
adodataset1.DisableControls;
for j:=1 to adodataset1.RecordCount do begin
for i:=1 to adodataset1.RecordCount do begin
array2[j]:=adodataset1.fieldbyname('应力').asinteger;
array1[i]:=adodataset1.fieldbyname('温度').AsInteger;
adodataset1.Next;
dbchart1.Series[0].Add(array2[j]-array1[i],'B',clblue);
end;
adodataset1.EnableControls;
end;
end;
end.