mckz
还是不行啊
你可以看看我的代码先:
procedure maOperator(function_id, op_code, op_type: Integer; const op_name,
password, summary: WideString; var iResult, vDatas,
sErrorMsg: OleVariant); safecall;
procedure TcomFundIntrustSP.maOperator(function_id, op_code,
op_type: Integer; const op_name, password, summary: WideString;
var iResult, vDatas, sErrorMsg: OleVariant);
var
i:integer;
begin
//连接到数据库,如果连接失败则退出
Connection2Server;
if not Linked then Exit;
with adoSP do
begin
Close;
Prepared := False;
ProcedureName := 'maOperator';
Parameters.Clear;
for i:=0 to 6 do
Parameters.add.Index := i;
Parameters[0].Name := '@Return_value';
Parameters[1].Name := '@function_id';
Parameters[2].Name := '@op_code';
Parameters[3].Name := '@op_type';
Parameters[4].Name := '@op_name';
Parameters[5].Name := '@password';
Parameters[6].Name := '@summary';
Parameters[0].DataType := ftInteger;
Parameters[1].DataType := ftinteger;
Parameters[2].DataType := ftinteger;
Parameters[3].DataType := ftinteger;
Parameters[4].DataType := ftWideString;
Parameters[5].DataType := ftWidestring;
Parameters[6].DataType := ftWideString;
Parameters[0].Direction := pdReturnValue;
for i:=1 to 6 do
Parameters.Direction := pdInput;
Parameters.ParamByName('@function_id').Value := function_id;
Parameters.ParamByName('@op_code').Value := op_code;
Parameters.ParamByName('@op_type').Value := op_type;
Parameters.ParamByName('@op_name').Value := op_name;
Parameters.ParamByName('@password').Value := password;
Parameters.ParamByName('@summary').Value := summary;
Prepared := True;
ExecProc;
end;
// iResult := adoSP.Parameters[0].Value;
iResult := adoSP.Parameters[0].Value;
if( iResult >0) then
begin
sErrorMsg:= '';
if function_id in [101] then
vDatas := GetXMLData;
end
else
begin
QueryErrorMessage(iResult, sErrorMsg);
end;
end;