CDatabase::SetLoginTimeout
This documentation is archived and is not being maintained.

CDatabase::SetLoginTimeout

Call this member function — before you call OpenEx or Open — to override the default number of seconds allowed before an attempted data source connection times out.

void SetLoginTimeout(
   DWORD dwSeconds 
);

Parameters

dwSeconds
The number of seconds to allow before a connection attempt times out.

Remarks

A connection attempt might time out if, for example, the DBMS is not available. Call SetLoginTimeout after you construct the uninitialized CDatabase object but before you call OpenEx or Open.

The default value for login timeouts is 15 seconds. Not all data sources support the ability to specify a login timeout value. If the data source does not support timeout, you get trace output but not an exception. A value of 0 means "infinite."

See Also

CDatabase Overview | Class Members | Hierarchy Chart | CDatabase::OnSetOptions | CDatabase::SetQueryTimeout

Show:
© 2016 Microsoft