Initializing CdbDBEngine
The CdbDBEngine class initializes the DAO DBEngine object. This is different from Microsoft Visual Basic. There are two constructors, as follows:
-
Both constructors call CoCreateInstance to create an instance of the DBEngine object and obtain a DAODBEngine interface pointer (the underlying OA interface as defined in dbdaoint.h). The same constructor allows you to add an additional reference to an existing instance of the DBEngine.
-
The other constructor actually takes five parameters, allowing the user to specify the default user, the default password, the IniPath, whether the DBEngine object is private or shared, and whether to start the engine on construction. Once the engine is started, these properties cannot be modified.
Each private engine is a new instance of DAO. A shared engine is common across all instances, enabling them to share open workspaces, databases, recordsets, and so on.
If you don't start the engine on construction, there is a Start method that starts it.
Before invoking the Start method, you can override the default Registry key by setting the IniPath property and override the default workgroup information file by setting the SystemDB property.