Passing parameters to ADODataSet
Posted on 2000-03-22
I have a problem to retrieve the record from ADODataSet by changing its parameters:
ADODataSet of CommandType cmdStoredProc is connected to Access2000 query.
Query is a simple:
SELECT * FROM CLIENT WHERE CODE = [:INVALUE]
I open the query with:
with qryClient do begin
Parameters.Items.Value := sCode;
When I assign value to the Parameters of the dataset, everything works correct for the first time. However every subsequent assigning of parameter value does not locate the correct record.
Calling for the first time with Code='A' the query retrieves 'Client A'
Calling next time with code='B' will still return 'Client A'
I realise that using 'locate' or 'filter' on full client query would be a solution, but in my case qryClient is required to hold only one record