CDaoDatabase::CDaoDatabase

CDaoDatabase( CDaoWorkspace* pWorkspace = NULL );

Parameters

pWorkspace

A pointer to the CDaoWorkspace object that will contain the new database object. If you accept the default value of NULL, the constructor creates a temporary CDaoWorkspace object that uses the default DAO workspace. You can get a pointer to the workspace object via the m_pWorkspace data member.

Remarks

Constructs a CDaoDatabase object. After constructing the object, if you are creating a new Microsoft Jet (.MDB) database, call the object’s Create member function. If you are, instead, opening an existing database, call the object’s Open member function.

When you finish with the object, you should call its Close member function and then destroy the CDaoDatabase object.

You might find it convenient to embed the CDaoDatabase object in your document class.

Note   A CDaoDatabase object is also created implicitly if you open a CDaoRecordset object without passing a pointer to an existing CDaoDatabase object. This database object is closed when you close the recordset object.

For information about workspaces, see the article . For information about using CDaoDatabase objects, see the article . These articles are in Visual C++ Programmer's Guide.

CDaoDatabase OverviewClass MembersHierarchy Chart