delphi xe10.4.2 tabletojson函数显示E2033错误

如题,测试了一下使用tdbxjsontools.tabletojson函数,第一个参数如果如下写法acommand.executequery那么显示

function TServerMethods1.getData: string;
var
    acommand:tdbxcommand;
    areader:TDBXReader;
begin
    result:='';
    self.SQLConnection1.open;
    //self.SQLConnection1.Params['database'].t
    acommand:=self.SQLConnection1.DBXConnection.CreateCommand;
    //acommand:=webmoduleunit1
    acommand.Text:='select id,firstname,lastname from tblist';
    acommand.Prepare;
    areader:=acommand.ExecuteQuery;
    result:=tdbxjsontools.TableToJSON(acommand.ExecuteQuery,10,true).ToString;
    //result:=tdbxjsontools.TableToJSON(areader,8,true).ToString;
    acommand.Free;
    //areader.Free;
end;

[dcc32 Error] ServerMethodsUnit1.pas(50): E2033 Types of actual and formal var parameters must be identical。

只能先把sql查询结果赋值给areader,然后再用这个函数,就正常了。

百思不得其解。


版权声明:本文为g58521547原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接和本声明。