Subject | RE: [ib-support] Testing if FB is running from Delphi. |
---|---|
Author | Pete Bray |
Post date | 2002-10-21T18:06:43Z |
> Raymond Kennington wroteRaymond,
> How does one test if FB is running already when a Delphi app starts?
>
> Should I try to connect and test for an error? If so, what's the
> exception?
for win9x you can walk the process list to check for the server process.
for win2k etc you can use the NT services api to check the service status.
however, my preferred solution is to ping the server using a basic tcp comms
component (I use the indy ones). Just set the ip and port for the component
and try and connect, test the connect status and then disconnect. This has
the advantage of working for local and remote. Also, if it fails, it tells
you the server is not running rather than maybe the database is not present.
Kind regards,
Pete