Mike (mc*****@gmail. com) writes:
I have a VB6 program on my PC that connects into and looks at a slq
server 7 table on a development server. This server is rebooted
everynight. Everytime the connection is interupted, an error message
pops up. This is expected to happen, but I wanted to delay this error
message from popping up and give the server a chance to reboot. I put
the statement
'cnn.Connection Timeout = 600' -> cnn is a new connection
to delay the vb program 10 minutes and then reconnect when the
connection is found. When the connection is found again - an error
message still pops up saying:
"The following error occured in the function BuildStepArray:
-2147467259
Description: Cannot open the database requested in login
'DBA_Utilities' . Login fails."
I wanted this delay in the vb program so an error message wouldnt pop
up unless the server was really down.
Does anyone know what this message could mean or how to fix this??
The message means that the database you are trying to access is not
available. The server is up, but for whatever reason the database is
not yet available. This could be because your DBA is running some
maintenance job, and keep the database in single-user mode.
However, I think the problem is that since you so eagerly keeps waiting
for the server to come up, you will get in as soon as SQL Server starts
to accept connections. However, at this point databases that needs recovery
will not be available. And I will guess that this is what's happening.
I would suggest that the best is set up an error handler, and catch
the connection-timeout message, and then wait for a couple of minutes
before you connect again. You would not extend the connection timeout.
Since even in this case there is a small risk that you knock on the
door when it just has opened, but the database is still in bed, you
should probably handle the "Cannot open..." message as well.
--
Erland Sommarskog, SQL Server MVP,
es****@sommarsk og.se
Books Online for SQL Server SP3 at
http://www.microsoft.com/sql/techinf...2000/books.asp