In ADO, we had to pass all input parameters as variants, like so:
Code: Select all
Query.Parameters.ParamByName(‘SOMEDATE’).Value := dtStartDateTime + iNumOfDays;
I tried to fix this, by deriving my own TParam from TMSParam in which the method SetAsVariant was overridden like so:
Code: Select all
procedure THCParam.SetAsVariant(const Value: Variant);
begin
if (DataType = ftDate) then
AsDate := Value
else if (DataType = ftDateTime) then
AsDateTime := Value
else
inherited;
end;
- Is there a way to have the “.Value”-property interpret the date correctly?
- Is there a way to determine the DataType of a parameter?