D
delphiboy
Unregistered / Unconfirmed
GUEST, unregistred user!
中间层:
---------------------
GWData:variant* |
---------------------
if adoqueryA.RecordCount>0 then
begin
GWData:=VarArrayCreate([1,adoqueryA.RecordCount,0,5],varOleStr);
AdoqueryA.First;
i:=1;
while not AdoqueryA.Eofdo
begin
GWData[i,0]:=AdoqueryA.fieldByName('收货单Nr').AsString;
GWData[i,1]:=AdoqueryA.fieldByName('收货记录号码').AsString;
GWData[i,2]:=AdoqueryA.fieldByName('供应商Nr').AsString;
GWData[i,3]:=AdoqueryA.fieldByName('收货人').AsString;
GWData[i,4]:=AdoqueryA.fieldByName('收货日期').AsInteger;
adoqueryA.Next;
inc(i);
end;
end else
begin
GWData:=Null;
end;
客户端:
if Main.ConnectionBroker2.AppServer.GetYzdwfkjl(querysql,Gwdata,ErrorInfo) then
begin
RowCount :=VarArrayHighBound(Gwdata,6) ;
--这里报错!为什么?
listview2.items.clear ;
for i:=0 to (ROWcount-1)do
begin
listview2.Items.Add;
listview2.Items.Caption:=trim(Gwdata[i,0]);
listview2.Items.SubItems.add(trim(Gwdata[i,1]));
listview2.Items.SubItems.add(trim(Gwdata[i,2]));
listview2.Items.SubItems.add(trim(Gwdata[i,3]));
listview2.Items.SubItems.add(trim(Gwdata[i,4]));
listview2.Items.SubItems.add(trim(Gwdata[i,5]));
end;
end else
begin
MessageDlg(ErrorInfo,mtError, [mbYes], 0);
end;
客户端收到数据后,得到行数的时候报错,为什么?