The DAO method samples are provided as source files in the directory Samples\dbdao InstallDirectory\DAOSDK\SAMPLESon the MSDN Library disc. You can copy, compile, and execute them in a Microsoft Visual C++ project. The method samples are the Microsoft Visual C++ equivalents of the Microsoft Visual Basic DAO method samples. In order to correspond as closely as possible to the Visual Basic samples, the Microsoft Visual C++ method samples are designed as ANSI console applications.
Examples should be simple, so common functions as defined in stdio.h are used whenever possible. When necessary, less common routines as defined in conio.h are used. DAO depends on the COleVariant and CString Microsoft Foundation Classes (MFC), and objects from these classes are used often in the samples.
The procedures for creating samples are listed below. In order to build the samples, create a dummy project in Microsoft Visual C++, and a dummy source file within that project. When you want to test a sample, copy and paste it into the dummy source file then build the project.
We suggest naming the project avatar.mdp, and the source file, avatar.cpp. (An "avatar" is the embodiment of something else. Avatar.cpp will embody each sample. Using it will conserve disk space and minimize compilation time.). This procedure assumes everything listed below is done in one session.
To create the Avatar workspace
To create the Avatar source file
To configure the Avatar project, you must select the project, then specify the Tools and Build settings, and save the project.
To configure Avatar project
To specify the Tools settings
To specify the Build settings
When you have finished configuring the Avatar project, you must close the Workspace.
To close the Workspace
To Select the Library Modules
Note Other choices are ddao35.lib (ANSI Release), ddao35ud.lib (Unicode Debug), and ddao35u.lib (Unicode Release).
If you cannot debug trace into dbDAO libraries, you may need to copy the debug version of the .dll or .pdb files into your Windows\System (for Win95) or Windows\System32 (for Windows NT) directory.
To rebuild the sample