What is AnyID
? With questions like this better to show datatype declaration and value assigned.
As a general suggestion - don't use .Value
, try ParamByName('ID').AsInteger
or ParamByName('ID').AsString
or what u actually need that certain parameter to be.
Not only that would be faster but it also produces more determinate code with compile-time type checking, rather than significantly slower and much less predictable runtime dynamic Variant
datatype conversions.
This applies to Fields
as well as too Parameters
.