W
wyic
Unregistered / Unconfirmed
GUEST, unregistred user!
我用想用getalltables来取得数据库的所有表名,但总出现 Not enough actual parameters错误
procedure TDynamicSql.getalltables(var vtables: OleVariant);
var
tbllist : Tstringlist;
icount : Integer;
begin
try
tbllist:= Tstringlist.create;
ADOCDSQL.GetTableNames(tbllist);
vtables:=VarArrayCreate.([0, tbllist.count-1], varVariant);
for icount:=0 to tbllist.count-1 do
begin
vtables[icount]:=tbllist.strings[icount];
end;
finally
tbllist.free;
end;
end;
procedure TDynamicSql.getalltables(var vtables: OleVariant);
var
tbllist : Tstringlist;
icount : Integer;
begin
try
tbllist:= Tstringlist.create;
ADOCDSQL.GetTableNames(tbllist);
vtables:=VarArrayCreate.([0, tbllist.count-1], varVariant);
for icount:=0 to tbllist.count-1 do
begin
vtables[icount]:=tbllist.strings[icount];
end;
finally
tbllist.free;
end;
end;