Trouble setting value of integer parameter for Insert Statement

  • Thread starter Thread starter Charles Fineblum
  • Start date Start date
C

Charles Fineblum

Hi:

I'm trying to add a parmater of OleDbType SmallInt. It supposed to map to
int16, so I do the following:

OleDbParameter* pP2 = new OleDbParameter(S"FK_tblRaces",
OleDbType::SmallInt, 0);
pP2->Value = Int16(5); // 5 is value
this->oleDbInsertCommand1->Parameters->Add(pP2);

It bombs because not object*. How do you get object* of Int16?

Thanx,
Charlie
 
It bombs because not object*. How do you get object* of Int16?

You box it...

Int16 nValue = 0;
Object *pObject = __box(nValue);


/Andreas
 
Back
Top