Compartir a través de


CDaoWorkspace::Idle

Call Idle to provide the database engine with the opportunity to perform background tasks that may not be up-to-date because of intense data processing.

static void PASCAL Idle( 
   int nAction = dbFreeLocks  
);

Parameters

  • nAction
    An action to take during the idle processing. Currently the only valid action is dbFreeLocks.

Remarks

This is often true in multiuser, multitasking environments in which there is not enough background processing time to keep all records in a recordset current.

Nota

Calling Idle is not necessary with databases created with version 3.0 of the Microsoft Jet database engine. Use Idle only for databases created with earlier versions.

Usually, read locks are removed and data in local dynaset-type recordset objects is updated only when no other actions (including mouse movements) are occurring. If you periodically call Idle, you provide the database engine with time to catch up on background processing tasks by releasing unneeded read locks. Specifying the dbFreeLocks constant as an argument delays processing until all read locks are released.

This member function is not needed in single-user environments unless multiple instances of an application are running. The Idle member function may increase performance in a multiuser environment because it forces the database engine to flush data to disk, releasing locks on memory. You can also release read locks by making operations part of a transaction.

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

Requirements

Header: afxdao.h

See Also

Concepts

CDaoWorkspace Class

CDaoWorkspace Members

Hierarchy Chart