主题:数组越界?还是表不存在??
procedure TFormdfstaff.setdf;
var
params:array of string;
begin
if length(editdfstaff.text) = 0 then
exit;
if length(editsq.text) = 0 then
exit;
with dfstaff do
begin
close;
params[0].asstring := sqgsjbxx.fieldbyname('id').asstring;
params[1].asstring := editdfstaff.text;
open;
first;
if eof then
begin
dfmb.First;
while not dfmb.Eof do
begin
append;
fieldbyname('sqid').AsString :=
sqgsjbxx.fieldbyname('id').asstring;\\出错
fieldbyname('staffname').AsString :=
editdfstaff.Text;\\出错
fieldbyname('dfid').AsString :=
dfmb.fieldbyname('dfid').AsString;出错
fieldbyname('group').AsString :=
dfmb.fieldbyname('group').AsString;\\出错
fieldbyname('item').AsString :=
dfmb.fieldbyname('item').AsString;\\出错
post;
dfmb.Next;
end;
end;
close;
open;
end;
end;
实在是不明白为什么这些地方出错,谁能帮帮我呢?
var
params:array of string;
begin
if length(editdfstaff.text) = 0 then
exit;
if length(editsq.text) = 0 then
exit;
with dfstaff do
begin
close;
params[0].asstring := sqgsjbxx.fieldbyname('id').asstring;
params[1].asstring := editdfstaff.text;
open;
first;
if eof then
begin
dfmb.First;
while not dfmb.Eof do
begin
append;
fieldbyname('sqid').AsString :=
sqgsjbxx.fieldbyname('id').asstring;\\出错
fieldbyname('staffname').AsString :=
editdfstaff.Text;\\出错
fieldbyname('dfid').AsString :=
dfmb.fieldbyname('dfid').AsString;出错
fieldbyname('group').AsString :=
dfmb.fieldbyname('group').AsString;\\出错
fieldbyname('item').AsString :=
dfmb.fieldbyname('item').AsString;\\出错
post;
dfmb.Next;
end;
end;
close;
open;
end;
end;
实在是不明白为什么这些地方出错,谁能帮帮我呢?