CDaoRecordset with SetParamValue()
Posted on 2003-10-27
I would like to use a parameterized query with CDaoRecordset, using the members m_nParam and SetParamValue(). I have a query like
select * from TabX where FieldX = [ValueX] And FieldY = [ValueY]
where [ValueX] and [ValueY] are the parameters I would like to change at run time.
I am currently instantiating a CDaoRecorset child and using this query (with the actual values instead of parameter names) by calling CDaoRecordset::Open().
How do I write a parameterized query? How do I use SetParamValue() to set the actual values of the parameters?
Many thanks for your help.