Changing ADO to SDAC and parameters
Posted: Tue 24 Aug 2010 10:35
Hello! I use demo version to change ADO by SDAC. But have trouble with auto describing parameters. I use code:
Then i have changed Execute( Result, aParams) to
And it does not work because SDAC can not describe parameters for expression like 'exec p_Tasks_Decline :ID, :Text'. Is it true? How should i change code? I use this approach very often in many places.
Thanks
Code: Select all
function TdmData.ExecQueryPrm( const aSQL: String; var aParams: Variant): Integer;
var i: Integer;
begin
with TADOCommand.Create(nil) do
try
Connection := acData;
CommandText := aSQL;
Parameters.Refresh;
Execute( Result, aParams);
for i := 0 to Parameters.Count-1 do
if Parameters.Items[i].Direction in [ pdOutput, pdInputOutput] then
aParams[i] := Parameters.Items[i].Value;
finally
Free;
end;
end;
Code: Select all
for i := 0 to Params.Count-1 do
if Params.Items[i].ParamType in [ ptInput, ptInputOutput] then
Params.Items[i].Value := aParams[i];
Execute;
Thanks