
Unknown Error "Application timed out"???
Both CDatabase and an ADO Connection have two separate timeout values that
can be set. One is for login/connection. This is the value that the
database will wait before deciding it will not be possible to establish a
connection to the database. The other is for query/command. This is the
amount of time a single (SQL) command can run without timing out.
For the login/connection, look at the following:
CDatabase::SetLoginTimeout(...), _ConnectionPtr::GetConnectionTimeout(...),
and _ConnectionPtr::SetConnectionTimeout.
For the query/command, take a look at the following:
CDatabase::SetQueryTimeout(..), _ConnectionPtr::GetCommandTimeout(...), and
_ConnectionPtr::SetCommandTimeout(...).
It sounds as of your problem comes at login/connection time when you are
first establishing your database connection. This could be because of bad
connection parameters, a busy network, etc.
TFM3
Note: Spam-resistant e-mail address
Quote:
> I am writing a large application which makes in visual C++ (SDI app)
> which makes use of MFC, a mix of ADO and CDatabase transactions
> (CDatabase ones from older code and ADO in the newer code) and also
> using a COM object which is installed as a service on my machine.
> Some of the test sites that are running my application get an
> "Application timed out" error on startup (before the user logs in).
> Can anyone give me an indication and some examples of what might cause
> this error to occur. i have found no reference to this error after
> several hours of searching on msdn, the web and newsgroups.
> Thanks in advance
> Andy :-)