我做的com+組件,在AP層上定義如下
function Tzhqd.GetData(const FSql: WideString): OleVariant;
begin
with qryServer do
begin
close;
sql.Clear ;
sql.Add(FSql);
Prepare;
ExecSql;
end;
result := qpServer.Data ;
end;
qpServer.Data為DataSetProvider在client 上調用
dsMain.Data := Dcon.AppServer.GetData('select count(*) from bsh_file');
總出現錯誤提示
variant does not reference an automation object
都快煩死我了,各位高手幫幫忙,100相送,謝謝
function Tzhqd.GetData(const FSql: WideString): OleVariant;
begin
with qryServer do
begin
close;
sql.Clear ;
sql.Add(FSql);
Prepare;
ExecSql;
end;
result := qpServer.Data ;
end;
qpServer.Data為DataSetProvider在client 上調用
dsMain.Data := Dcon.AppServer.GetData('select count(*) from bsh_file');
總出現錯誤提示
variant does not reference an automation object
都快煩死我了,各位高手幫幫忙,100相送,謝謝
insert等使用ExecSql.
大概是这样吧!
問題好像在參數錯誤,根本沒進入function中,如果是sql出錯不應該是這個提示.
而且open与ExecSQL 只是對數据集是否有返回直操作,我需要返回整個數据結果,應該与這個沒影響 .
请问如何在OLE/Automation中返回数据集呢
http://www.delphibbs.com/delphibbs/dispq.asp?lid=497243
也是這個問題,和我寫的差不多,但我這個總出錯.
begin
with qryServer do
begin
close;
sql.Clear ;
sql.Add(vartostr(FSql));
Prepare;
ExecSql;
end;
result := qpServer.Data ;
end;
qpServer.Data為DataSetProvider在client 上調用
dsMain.Data := Dcon.AppServer.GetData('select count(*) from bsh_file');
试试?