G
Guest
I am developing a windows application that uses a SQL Server Express 2005
database back-end. I am currently connecting using user instances and I am
also using a data access layer. I am trying to implement some automatic
program fixing techniques during application startup; i.e. if the previous
time the user ran the application it crashed and left the database connection
open, then it could safely close and re-open the connection on startup again.
To reproduce this problem, I'm intentionally throwing an exception in my
application so that it can't exit properly. I notice that when I use the
SSEUtil.exe program, it shows the database as still being attached after a
crash. I would like to be able to check to see if the database is already
attached, detach it, then attach it again with my current data layer
(connection objects).
I have 2 questions for this problem; On the startup of my application Is
there a way to check to see if a database is currently attached and...
- just use it in my objects in the SQL Server Exress 2005 environment?
- detach the current connection and re-attach my own instead?
I don't want to have to implement the SSEUtil during install if possible.
My application is going to be deployed as a Windows Service AND a Windows
Application. As a service, it is going to monitor files and write the logs
to the database. Then, when the user logs into the machine, it will open the
client application and access the same database as the service. Since it is
possible for both the service and the client app to run at the same time, is
it possible for both of them to access the same database at the same time on
the same machine? I'm open to suggestions and I appreciate your help. Thanks
in advance.
database back-end. I am currently connecting using user instances and I am
also using a data access layer. I am trying to implement some automatic
program fixing techniques during application startup; i.e. if the previous
time the user ran the application it crashed and left the database connection
open, then it could safely close and re-open the connection on startup again.
To reproduce this problem, I'm intentionally throwing an exception in my
application so that it can't exit properly. I notice that when I use the
SSEUtil.exe program, it shows the database as still being attached after a
crash. I would like to be able to check to see if the database is already
attached, detach it, then attach it again with my current data layer
(connection objects).
I have 2 questions for this problem; On the startup of my application Is
there a way to check to see if a database is currently attached and...
- just use it in my objects in the SQL Server Exress 2005 environment?
- detach the current connection and re-attach my own instead?
I don't want to have to implement the SSEUtil during install if possible.
My application is going to be deployed as a Windows Service AND a Windows
Application. As a service, it is going to monitor files and write the logs
to the database. Then, when the user logs into the machine, it will open the
client application and access the same database as the service. Since it is
possible for both the service and the client app to run at the same time, is
it possible for both of them to access the same database at the same time on
the same machine? I'm open to suggestions and I appreciate your help. Thanks
in advance.