Compartilhar via


CDaoWorkspace::Close

Call this member function to close the workspace object.

virtual void Close( );

Remarks

Closing an open workspace object releases the underlying DAO object and, if the workspace is a member of the Workspaces collection, removes it from the collection. Calling Close is good programming practice.

Warning

Closing a workspace object closes any open databases in the workspace. This results in any recordsets open in the databases being closed as well, and any pending edits or updates are rolled back. For related information, see the CDaoDatabase::Close, CDaoRecordset::Close, CDaoTableDef::Close, and CDaoQueryDef::Close member functions.

Workspace objects are not permanent; they only exist while references to them exist. This means that when the database engine session ends, the workspace and its Databases collection do not persist. You must re-create them for the next session by opening your workspace and database(s) again.

For related information, see the topic "Close Method" in DAO Help.

Requirements

Header: afxdao.h

See Also

Reference

CDaoWorkspace Class

Hierarchy Chart

CDaoWorkspace::Open