Hi all,

Am using Access2k as database for my db application.

i have created a query which requires 3 parameters: DateFrom, DateTo and aDateType.

In delphi i use TADOStoredProc to get data from the query/view in access

why does this not work?
with Orders do begin //Orders is TADOStoredProc
Close;
Parameters.ParamByName('DateFrom').Value := dpFrom.Date;
Parameters.ParamByName('DateTo').Value := dpTo.Date;
Parameters.ParamByName('aDateType').Value := cbDateTypes.Text;
Open;
end;

instead i have to delete and then recreate the parameters as follows:
with Orders do begin //Orders is TADOStoredProc
Close;
Parameters.Clear;
Parameters.CreateParameter('DateFrom', ftDateTime, pdInput, 0, dpFrom.Date);
Parameters.CreateParameter('DateTo', ftDateTime, pdInput, 0, dpTo.Date);
Parameters.CreateParameter('aDateType', ftString, pdInput, 13, cbDateTypes.Text);
Open;
end;

Had i been usin a TADOQuery, the 1st aproach works fine. Why does it not work for a TADOStoredProc?

TIA.

cpmasesa