Re: Parameters in MS Access



I'm getting an error message 'Jet database does not recognize [yID] as an
invalid field name or expression' for the following code. The parameter
value [yID] is invalid for some reason. I'm using MSAccess2000 with D6. What
is the problem?

ADODataSet.Parameters.ParamByName('[yID]').Value:= X_.FieldValues['ID'];
ADODataset.Active:= false;
ADODataset.CommandText:= 'TRANSFORM First(X.TIME) AS FirstOfTIME '+
'SELECT X.ID, X.NO, '+
'WHERE (X.ID) = [yID]'+
'GROUP BY X.ID, X.NO '+
'PIVOT X.NO ';
ADODataset.Open;


Parameters in a delphi query are preceded by a colon
WHERE (X.ID) = :yID

--
Brian Bushay (TeamB)
Bbushay@xxxxxxxxx
.