Checking for database in use

J

John

Hi

Is there a way to check if a backend db is in use by any user? I need to
check this to decide whether to initiate a compact.

Thanks

Regards
 
A

aaron.kempf

there is no easy way to do this-- except to see if there is a LDB
file.

Even that can be wrong sometimes-- if a server is bounced while it is
open-- the LDB file will still exist.

you could always right-click 'my computer' on the server.. choose
manage.. and look under 'open files'.. I believe that this is all
under the first 'node' in 'Computer Management'.

Using that node (in compmgmt.msc) will allow you to tell _WHICH_ files
are open anywhere on the server.. I believe that it will even let you
close opened files sometimes.

And then the alternatives..

'St Bernard Software' has a product called 'Open File Manager' or
something like that (or at least they did a decade ago) that was
specificially designed for backup of files that were currently open.

I haven't heard of them in a year; I was working at www.ultrabac.com
back in '99 and they talked a lot abot that product way back then..
I'm pretty darn sure that they are still around.

And then of course; you can programmatically close a file if it hasn't
been used in 5 minutes.. if you make a form that has an 'ontimer'
event.. But from what someone else said-=- you've got to disable that
timer even when you're working on another form.. which-- seems to me
-- to defeat the intended purpose.

SQL Server-- doesnt' have any problems taking backups while people are
_IN_ the database.

SQL Server Express is _FREE_ and it is a much much much better product
than MDB / ACCDB.

HTH

-Aaron
-Aaron

-Aaron
 
T

Tom van Stiphout

On Tue, 25 Mar 2008 02:12:28 -0000, "John" <[email protected]>
wrote:

Initiate it, and if it fails the runtime error will be an indication
it was in use.
The occurrence of an LDB file most often is also a good indicator.

-Tom.
 
Top