用ado直接调用dbf数据库运行到512次出错
我用ado直接连接dbf表,往tbzqdm.dbf中添加1000条记录,
可是运行到512次就报出错(too many variables),dbf中也添加了512条正确的
纪录,为什么!!!
adoconnect string:
Provider=VFPOLEDB.1;Data Source=D:\myVFP;Password="";
Collating Sequence=MACHINE
是adoconnect 自动buid的,而且test connect成功的
环境:win2000,Delphi7,vfpoledb.dll(8.0),Ms VFP6的table
======================================================
procedure TForm1.Button1Click(Sender: TObject);
var
aBh:array[1..1000] of integer;
i:longint;
begin
ADOConnection1.Open;
ADOQuery1.SQL.Clear;
for i:=1 to 1000 to do aBh[i]:=i;
ADOQuery1.SQL.Add('Insert into tbzqdm(dm)');
ADOQuery1.SQL.Add(' values(:DD)');
try
for i :=1 to 1000 do
begin
ADOQuery1.Parameters.ParamValues['DD']:=aBH[i];
ADOQuery1.ExecSQL;
end;
finally
aBH:=nil;
ADOQuery1.Close;
ADOConnection1.Close;
Label1.Caption:='Finished!!';
end;
end;
=======================================================
我看到一个sql语句是insert into table array arrayname
如何用?
我改写成
ADOQuery1.SQL.Add('Insert into tbzqdm array aBh');
运行出错。
改成
ADOQuery1.SQL.Add('Insert into tbzqdm array :DD');
ADOQuery1.Parameters.ParamValues['DD']:='aBH';
也错。
改成
ADOQuery1.Parameters.ParamValues['DD']:=aBH;
也错。出错的代码是:syntax error
如何写?