Reputation:
I have used the Borland IDE to connect to Access Databases for a while now but Borland got bought and the upgrade is more than I can afford so I am trying to switch to Visual C++ Express. I can get the explore data to show my databases how do I get from there to being able to read the records and work with them?
Which controls do I need and what do the properties need to be set too? The rest I can do.
Any assistance would be appreciated.
Upvotes: 0
Views: 870
Reputation: 1167
Take a look at this set of ADO classes, full source with samples at codeproject http://www.codeproject.com/KB/database/caaadoclass1.aspx
Opening Access database (quoted from article):
//Sample with Connection String for Access database
CADODatabase* pAdoDb = new CADODatabase();
CString strConnection = _T("");
strConnection = _T("Provider=Microsoft.Jet.OLEDB.4.0;"
"Data Source=C:\\VCProjects\\ADO\\Test\\dbTest.mdb");
pAdoDb->SetConnectionString(strConnection);
if(pAdoDb->Open())
{
DoSomething();
.
.
.
pAdoDb->Close();
}
delete pAdoDb;
Upvotes: 1