CDaoDatabase MyDatabase; //Create Object
//Open Database
MyDatabase.Open( "Pathname of your Database", FALSE, FALSE, _T("" );
CDaoTableDef td( &MyDatabase ); //Create Tabledef
td.Open("YourTable" ); //Open it
CDaoRecordset tabell;
tabell.Open(&td, dbOpenTable, 0 );
COleVariant vrnt = tabell.GetFieldValue("FeldOfInterest" ); //Get the Value
...
//Close it all
tabell.Close();
td.Close();
MyDatabase.Close();
Do not forget to check, if Your names are right (work with Exceptions) etc. etc.
At best, use Daoview and Daotable MFC samples.
You can search for keyword CDaoRecordset - there are a lot of answers on TekTips (my sample too)
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.