Subject Re: Check if IB server is running
Author gerbreown@mindspring.com
Thanks, I'll give that a try. Do you know how I can then shut down
the server when my application quits?



--- In IBObjects@egroups.com, "Luiz Alves" <cprmlao@i...> wrote:
> You could try what ib_console does:
>
> Here is :
>
> function IsIBRunning(): boolean;
> begin
> if GetWindow(GetDesktopWindow,GW_HWNDNEXT)=
FindWindow('IB_Server',
> 'InterBase Server') then
> result := false
> else
> result := true;
> end;
>
>
> function StartGuardian(): boolean;
> var
> lRegistry: TRegistry;
> lEXEName: string;
> lArray: array[0..255] of char;
> begin
> result := false;
> lRegistry := TRegistry.Create;
> try
> Screen.Cursor := crHourglass;
> lRegistry.RootKey := HKEY_LOCAL_MACHINE;
> if not
> lRegistry.OpenKey('Software\Borland\InterBase\CurrentVersion',False)
then
> ShowMessage('InterBase server is not installed on your
computer.')
> else
> lEXEName := Format('%s%s
> ',[lRegistry.ReadString('ServerDirectory'),'ibguard.exe']);
> finally
> if WinExec(StrPCopy(lArray,lEXEName),1) > 31 then
> result := true;
> lRegistry.Free;
> Screen.Cursor := crDefault;
> end;
> end;
>
> Luiz.
> ----- Original Message -----
> From: <gerbreown@m...>
> To: <IBObjects@egroups.com>
> Sent: Monday, November 27, 2000 5:57 PM
> Subject: [IBO] Check if IB server is running
>
>
> > Jason,
> >
> > Is there an IBO component that I can use from within my Delphi
> > application to see if the local IB server is currently running?
If it
> > is not running then I want to start it before my application tries
to
> > access any databases. I then want shut it down, if I started it,
just
> > before my applicition quits. If it was running when my
application
> > started then I would leave it run at appliction quit time.
> >
> > Thanks,
> >
> > Gerald S. Brown
> >
> >
> >
> >
> >