If you did not find the answer yet here is the standard procedure to access any DB from VC++ 6.0:
1. Create Data Source to your Oracle DB. You need to do it via Data Source in Control Panel
2. In StdAfx.h header file #include <afxdb.h> if you did not set your program with DB access
2. Add new class to your program for the table you want to access. View/Class Wizard/Add Class/Select Recordset or OleRecordSet/Select Data Source/Select table
3. Wizard creates header and .cpp files for you
4. Set up pointers to the Data Base and table:
CDatabase pdb; /*instance of DB class */
CPrice prc( &pdb ); /*instance of CPrice */
CPrice* pPRC = &prc; /*pointer to price instance*/
5. Open DB
try
{
int bRet = pdb.Open(NSTSource,FALSE,FALSE);
}
catch(CDBException* e)
{
AfxMessageBox("Unable to open NST data base, \n error:"
+ e->m_strError, MB_OK, 0);
}
6.Open your table with string to get your data:
CString szPriceString = "SELECT TOP 20 * FROM PriceHist ORDER BY Date DESC";
try
{
pPRC->Open(CRecordset::snapshot, szPriceString, CRecordset::none);
}
catch(CDBException* e)
{
CString szFunction("pPRC->Open");
CString szStock("All");;
HandleError(e, szFunction, szStock);
}
7. Do your navigation in the table with MoveFirst, MoveNext, MovePrev, etc.
Good luck, Pavel.