There's an API that stops multiple instances of an application from being instantiated but I can't remember what it's called.
However, if we think about this in simple terms, GetObject() will fail if the db is opened so you could give that a try. The other thing to do is to check for a lock...