If there a way to determine if Interbase Server is running or not?

M Tuttle delphi-db@elists.org
Fri, 12 Oct 2001 10:20:00 -0500


Thanks for your code snippet Gerald,

I do have one question.  In your DataModuleCreate() Near the bottom you do
not free your registry.  Do you do this in the DataModuleDestroy() and if so
why do you hold the registy open for such a long time?

Thanks

Mike

> Procedure TDO_DM.DataModuleCreate(Sender: TObject);
> Var
>   lRegistry: TRegistry;
>   i: Integer;
>   fDB, fHlp, lEXEName: String;
> Begin
>   file://Check to see if InterBase is running and start if not.
>   fHlp := ChangeFileExt(Application.EXEName, '.HLP');
>   Application.HelpFile := fHlp;
>   fDB := ChangeFileExt(Application.EXEName, '.GDB');
>   IB_DBDO.Database := fDB;
>   IB_DBDO.DatabaseName := fDB;
>   IBDatabase.DatabaseName := fDB;
>   If Not IsIBRunning Then
>     Begin
>       StartServer;
>     End;
>   lRegistry := TRegistry.Create;
>   lRegistry.RootKey := HKEY_LOCAL_MACHINE;
>   lRegistry.OpenKey('Software\Borland\InterBase\CurrentVersion', False);
>   lEXEName := Format('%s%s', [lRegistry.ReadString('RootDirectory'),
> 'isc4.gdb']);
>   IB_DBGDB.Activate;
> End;