CDaoWorkspace::SetLoginTimeout

static void PASCAL SetLoginTimeout( short nSeconds );
throw( CDaoException, CMemoryException );

Parameters

nSeconds

The number of seconds before an error occurs when you attempt to log in to an ODBC database.

Remarks

Call this member function to set the value of the DAO LoginTimeout property for the workspace. This value represents the number of seconds before an error occurs when you attempt to log in to an ODBC database. The default LoginTimeout setting is 20 seconds. When LoginTimeout is set to 0, no timeout occurs and the communication with the data source might hang.

When you are attempting to log in to an ODBC database, such as Microsoft SQL Server, the connection may fail as a result of network errors or because the server is not running. Rather than waiting for the default 20 seconds to connect, you can specify how long the database engine waits before it produces an error. Logging on to the server happens implicitly as part of a number of different events, such as running a query on an external server database. The timeout value is determined by the current setting of the LoginTimeout property.

For more information about workspaces, see the article . For more information about working with ODBC data sources through DAO, see the article . Both articles are in Visual C++ Programmer's Guide. For related information, see the topic "LoginTimeout Property" in DAO Help.

CDaoWorkspace OverviewClass MembersHierarchy Chart

See Also   CDaoWorkspace::GetLoginTimeout