这个函数那里有问题?
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
无法向参数赋值