Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Export (0) Print
Expand All

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 
);

dwSeconds

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

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."

Header: afxdb.h

Community Additions

ADD
Show:
© 2015 Microsoft