Creating a
C++/Access interface
Task :
Create a simple Visual C++
application (call it inter) which can read
data from the Access database created in the last task. This
data should be sorted by the use of SQL. More info on SQL may
be found here.
Instructions :
- Create a multi-document
application using the MFC AppWizard.
- Initialise the OLE/COM
libraries.
- Open the connection to the
Access file in the Document.
- Ensure the Access file is
closed by doing so automatically in the Document.
- Include the exception
handling code for ADO.
- Add the necessary classes to
show the data in a list control.
- Override the OnCreate()
function in the View.
- Initialise the listctrl's
data (as a check).
- Add an OnRButtonDown()
function to allow the data to be displayed when the user right
clicks the mouse.
Help :
Chapter 4 - "Database
programming with Visual C++ 6 in 21 days" - Lyn
Robison.
Click here for a worked example
Click here for the source code
Click here to return to menu