Re: parameterized queries: 3 problems



I can only guess that Execute changed my vtMissing variant
and that resulted in problems for every later usage of vtMissing

That is what I think.
Execute sees that the address is non-NULL so it attempts to store a count if
your doing INSERT, UPDATE or DELETE. And that messes up vtMissing. If your
Stored Procedure has a SET NOCOUNT ON then I beleive you would be okay (but
I would still use NULL as that is the correct course of action).

Thank you also for that tip with long/int. I did a short test
and will change that, too. I will also change all calls when
I used a short as an index (e.g. rs->Fields->Item[(short)0]->Value)
to use a long as an index. I hated to use the short cast, but
int did not work.

I use the L extension of a constant to signify long. It looks reasonably
neat.
I just do

// If working with other members of Field other than just "Value"
ADODB::FieldsPtr pFlds(rs->Fields);
pFlds->Item[0L]->Value;
pFlds->Item[1L]->Value;
pFlds->Item[2L]->Value;
pFlds->Item[3L]->Value;
:

or

// If working with just the "Value" in Field
rs->Collect[0L]
rs->Collect[1L]
rs->Collect[2L]
rs->Collect[3L]

Cheers

Stephen


.