这个函数那里有问题?

tanfo2002 2004-01-08 06:51:04
function TDM.DelInfoByDelType(DelType : TDelOperType;tmpInt : Integer;tmpStr:String):Boolean;
var
ErrorInfo : String;
spName : String;//´æ´¢¹ý³ÌÃû³Æ
begin
Result := False;
spName := '';
case DelType of
dotRTU : spName := 'DELRTUINFOBYRTUID';
dotLock : spName := 'DELINFOSBYLOCKID';
dotStaff : spName := 'DELINFOBYSTAFFID';
dotRole : spName := 'DELINFOBYROLEID';
end;
try
if spExecute.Active then
spExecute.Close;
spExecute.StoredProcName := spName;
case DelType of
dotRTU : spExecute.ParamByName('RTUIDNO').AsInteger := tmpInt;
dotLock : spExecute.Params[0].AsString := tmpStr;
dotStaff : spExecute.ParamByName('STAFFIDNO').AsString := tmpStr;
dotRole : spExecute.ParamByName('ROLEIDNO').AsInteger := tmpInt;
end;
spExecute.Prepare;
spExecute.ExecProc;
Result := spExecute.ParamByName('GetResult').AsBoolean;
except
Result := False;
case DelType of
dotRTU : ErrorInfo := 'ɾ³ýRTUʱ³öÏÖ´íÎó';
dotLock : ErrorInfo := 'ɾ³ýÈË¿×Ëøʱ³öÏÖ´íÎó';
dotStaff : ErrorInfo := 'ɾ³ýÔ±¹¤Ê±³öÏÖ´íÎó';
dotRole : ErrorInfo := 'ɾ³ý½Çɫʱ³öÏÖ´íÎó';
end;
writeLog('µ÷Óô洢¹ý³Ìʱ·¢ÏÖ´íÎó -> ' + ErrorInfo);
Exit;
end;
end;
其中spExecute 为TStoredProc
无法向参数赋值
...全文
24 回复 打赏 收藏 转发到动态 举报
写回复
用AI写文章
回复
切换为时间正序
请发表友善的回复…
发表回复

5,392

社区成员

发帖
与我相关
我的任务
社区描述
Delphi 开发及应用
社区管理员
  • VCL组件开发及应用社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧