X
xhyph
Unregistered / Unconfirmed
GUEST, unregistred user!
太奇怪了, 谁做过李维的<分布式多层应用系统篇>的2-1-4使用命令动态存取远程数据,为什么我按照书上定义个GetAllTables接口,却出错Statement expected but 'INITIALIZATION' found (100分)<br />在 Typlibrary里
name Type Modifier
vTables VARIANT* [In,Out]
procedure GetAllTables(var vTables: OleVariant); safecall;
procedure TSeverTest.GetAllTables(var vTables: OleVariant);
var
tblList:TStringList;
iCount:Integer;
begin
try
tblList:=TStringList.Create;
self.ADOConnection1.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;
一切都和书上的一样,如果李维的代码错,那么我打开随书的光盘里的例子,看看和我写的一样,为什么它能运行而我的却出现Statement expected but 'INITIALIZATION' found
name Type Modifier
vTables VARIANT* [In,Out]
procedure GetAllTables(var vTables: OleVariant); safecall;
procedure TSeverTest.GetAllTables(var vTables: OleVariant);
var
tblList:TStringList;
iCount:Integer;
begin
try
tblList:=TStringList.Create;
self.ADOConnection1.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;
一切都和书上的一样,如果李维的代码错,那么我打开随书的光盘里的例子,看看和我写的一样,为什么它能运行而我的却出现Statement expected but 'INITIALIZATION' found