Subject Re: [firebird-support] How to detect that Firebird 2 database is connected?
Author Daniel Albuschat
2008/1/11, mariofb123 <mariofb123@...>:
>
> To replace the Firebird database from within Delphi application, I
> first disconnect it and then run the command gbak -rep -v -user...
> However, if the database is already open (connected) using another
> external application such as IBExpert, I am not able to detect it from
> within my Delphi application, and the replace database process fails
> without any warning.
> Is there a way to programmatically check if the database is connected
> externally, before running gbak -rep ?

Yes, you can get a list of all connected users via the Firebird-API.

You can use the isc_database_info()-function together with the
isc_info_user_names command.

Depending on which toolset you use for your Firebird-connection,
there should be a much easier way, though.

Regards,

Daniel Albuschat

--
eat(this); // delicious suicide