首页 > 其他 > 详细

客户端远程方法声明

时间:2014-03-05 03:58:28      阅读:409      评论:0      收藏:0      [点我收藏+]

function TRemoteMethods.GetSearchSQLData(const sSQLStr: string;
clientdataset: TClientDataSet; dbType: Integer = 0): Boolean;
var
v: OleVariant;
begin
Result := False;
if (sSQLStr = ‘‘) or (not Assigned(clientdataset)) then
Exit;
SQLConnection1.Connected := False;
try
try
SQLConnection1.Connected := True;
except
on E: Exception do
begin
SysLog.WriteLog(‘TRemoteMethods.GetSearchSQLData‘ + E.Message);
Exit;
end;
end;
// 执行
SqlServerMethod1.Close;
SqlServerMethod1.SQLConnection := nil;
SqlServerMethod1.ServerMethodName := ‘‘;
SqlServerMethod1.SQLConnection := SQLConnection1;
SqlServerMethod1.ServerMethodName := ‘TSysMethods.GetSearchSQLData‘;
try
SqlServerMethod1.ParamByName(‘SQLStr‘).AsString := sSQLStr;
SqlServerMethod1.ParamByName(‘DBType‘).AsInteger := dbType;
SqlServerMethod1.ExecuteMethod;
v := Null;
if SqlServerMethod1.ParamByName(‘ReturnParameter‘).AsBoolean then
v := SqlServerMethod1.ParamByName(‘OV‘).Value;
if not VarIsNull(v) then
begin
clientdataset.Data := v;
Result := True;
end;
except
on E: Exception do
begin
SysLog.WriteLog(‘TRemoteMethods.GetSearchSQLData‘ + E.Message);
end;
end;
finally
SqlServerMethod1.Close;
SqlServerMethod1.SQLConnection := nil;
SqlServerMethod1.ServerMethodName := ‘‘;
SQLConnection1.Connected := False;
end;
end;

客户端远程方法声明,布布扣,bubuko.com

客户端远程方法声明

原文:http://www.cnblogs.com/hnxxcxg/p/3580446.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!