Re: Is there a reliable way to do this?



That's a good idea! The service is autostarting - or at least, starting
automatically - and I am not proceeding unless its status is running - but I
never thought of the error log for the recovery complete message. And yes, I
can see from the log that the timing problem is in milliseconds - it took
about 30 milliseconds to finish starting the tempdb, but my database was
trying to connect before those 30 milliseconds are up.

I'll try this and see what happens. Thanks a bunch!

"Allen Kinsel" <allen.kinsel@xxxxxxxxxxxxxxxx> wrote in message
news:9553483cc26c436d9cbf6e5af89a4a70@xxxxxxxxxxxxxx


What is a reliable way to check to ensure that all system DBs are
started when SQL Server (SQL Express) starts up?

I am using SQL Express 2005 for a desktop application in which the user
requires the application be started at windows log-in time (so that
nothing is ever visible on the desktop except the application.)
Starting the application involves opening connections to two application
databases.

When the application is started from the user's startup folder - that
is, right after log-in - there are often login failures reported by
..NetSQLClientData Provider - "Cannot open database [dbname] requested
by the login. The login failed. Login failed for user ...."

There are never any failures when started manually after login.

To deal with the things I THOUGHT might be causing this I made the
application check that the SQL Express service was running, and
increased the length of the connection time-out in the connection
string. Appears that these were not the cause of the problem. Examining
the SQL log shows that on startup, SQL Server has to start all its
internal databases. It looks like if this process is not complete
(usually it is the last db, tempdb, that isn't done with its startup)
my first connection fails. I suppose I could hardcode or put in the
configuration settings some sort of wait, or repeatedly try to open the
connection if the first time fails. But it seems like it would be safer to
just know the status of the system dbs.

So, is there a way to do this?

Thanks!

Elizabeth





I think that there is really 2 approaches to this, one is to start sql
express prior to the application. That is to say, have the sqlexpress
service set to autostart (if this is feasible) If you do it this way the
service will be started and available by the time the logon screen comes
up otherwise if your already polling the service state and that's not
working
im thinking that the only other real alternative would be to parse the
sql error log for the final "recovery complete" message. I would think
unless the user db's and/or tempdb database is rather large your probably
talking about milliseconds of timing on this issue.
-Allen


Posted by NewsLook (Trial Licence) from
http://www.ghytred.com/NewsLook/about.aspx





.



Relevant Pages

  • RE: Logging in in background
    ... wold take all kinds of modifictions as I'd need to be checking that each SQL ... my database and all have connection strings associated with them. ... I suspect that there is also an issue on the SQL Server side as I keep ...
    (microsoft.public.access.modulesdaovba)
  • Re: User not associated with trusted SQL Server connection
    ... > using the osql utility. ... > associated with a trusted SQL Server connection. ... > database or is it just for that instance. ...
    (microsoft.public.sqlserver.security)
  • RE: Getting Challenged when using SQL connection on .aspx page
    ... What would happen if i removed integrated security=sspi from the connection ... Just want the login token to be passed, ... Have webpage with following connection in the ... I have account to the database on the SQL server. ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: Is it just me or are there BIG problems with SQLCE 3.0?
    ... has been done with parameterised SQL, ... bit of code into my test which closes and reopens the database ... opening and closing the DB connection is not a good idea. ... // Display all error messages ...
    (microsoft.public.sqlserver.ce)
  • Re: Concurrent database access in SQL 2005 Mobile
    ... What version of SQL CE are you using? ... Are you accessing the database from an app written in C++? ... then opens his work forms and it's in those ... It wouldn't seem to me that you'd need a new connection to ...
    (microsoft.public.sqlserver.ce)