I am able to connect to oracle database and insert the records into the table using ADO.But i am not able to retrieve integer values from the oracle database.It is retrieving zero.
Can some body help me.
Printable View
I am able to connect to oracle database and insert the records into the table using ADO.But i am not able to retrieve integer values from the oracle database.It is retrieving zero.
Can some body help me.
Post your code.
Post the class declartion, and the code you're using to retrieve the number.
while(!dbase.m_pRecordset->adoEOF)
{
FieldPtr pfIDNO,pfldLastName;
_variant_t vIDNO,vLastName;
int nIDNO;
char c_szLastName[30];
//pfIDNO = dbase.m_pRecordset->Fields->GetItem((_variant_t)"EMP_LASTNAME");
//vIDNO = pfIDNO->Value;
//nIDNO = vIDNO.iVal;
/* pfIDNO = dbase.m_pRecordset->Fields->GetItem((_variant_t)"EMP_ID");
vIDNO = pfIDNO->Value;
nIDNO = vIDNO.iVal;
// WideCharToMultiByte(CP_ACP, 0, vLastName.bstrVal, -1,
// c_szLastName, sizeof(c_szLastName), NULL, NULL);*/
//TheValue = dbase.m_pRecordset->GetCollect("EMP_ID");
_bstr_t a = dbase.m_pRecordset->Fields->GetItem((_variant_t)"EMP_ID")->GetValue().lVal;
/* long l;
l=dbase.m_pRecordset->Fields->GetItem((_variant_t)"EMP_ID");
strcpy(tmp,(char *)_bstr_t(TheValue) );
m_cmbEmpID.AddString(tmp);*/
dbase.m_pRecordset->MoveNext();
/*TheValue=dbase.m_pRecordset->GetCollect((_variant_t)"EMP_ID");
strcpy(tmp,(char *)_bstr_t(TheValue) );
m_sLastName=tmp;
dbase.m_pRecordset->MoveNext();*/
}