Board index » delphi » How to use TDatabase in Windows NT 4.0 service

How to use TDatabase in Windows NT 4.0 service

Hi
//--------------------------------------------
    Database1 := TDatabase.Create(nil);
    Database1.AliasName := 'JXC';
    Database1.Connected := True;
//--------------------------------------------
Works well in Windows 95/98, when I add to a Windows NT 4.0 Service,
the last line can not work , who can guide me ?
Artgolf
 

Re:How to use TDatabase in Windows NT 4.0 service


How is the server name specified in the alias?  You can't connect via local
interbase from within a service; you have to use localhost:.

Dan

Quote
artgolf <artg...@winning.com> wrote in message

news:38D1E43F.F3D86B16@winning.com...
Quote
> Hi
> file://--------------------------------------------
>     Database1 := TDatabase.Create(nil);
>     Database1.AliasName := 'JXC';
>     Database1.Connected := True;
> file://--------------------------------------------
> Works well in Windows 95/98, when I add to a Windows NT 4.0 Service,
> the last line can not work , who can guide me ?
> Artgolf

Re:How to use TDatabase in Windows NT 4.0 service


Dan
  The gdb file and the service exists on the same NT server "lxserver", must I
specify the server name in the alias like "//lxserver/c:\program
files\jhsw\jhjxc.gdb" rather than "c:\program files\jhsw\jhjxc.gdb"?
Artgolf
Quote
Dan Palley wrote:
> How is the server name specified in the alias?  You can't connect via local
> interbase from within a service; you have to use localhost:.

> Dan

> artgolf <artg...@winning.com> wrote in message
> news:38D1E43F.F3D86B16@winning.com...
> > Hi
> > file://--------------------------------------------
> >     Database1 := TDatabase.Create(nil);
> >     Database1.AliasName := 'JXC';
> >     Database1.Connected := True;
> > file://--------------------------------------------
> > Works well in Windows 95/98, when I add to a Windows NT 4.0 Service,
> > the last line can not work , who can guide me ?
> > Artgolf

Re:How to use TDatabase in Windows NT 4.0 service


Use the tcp/ip syntax:

    localhost:c:\program files\jhsw\jhjxc.gdb

Dan

Quote
artgolf <artg...@winning.com> wrote in message

news:38D2E325.F9ECDE06@winning.com...
Quote
> Dan
>   The gdb file and the service exists on the same NT server "lxserver",
must I
> specify the server name in the alias like "file://lxserver/c:\program
> files\jhsw\jhjxc.gdb" rather than "c:\program files\jhsw\jhjxc.gdb"?
> Artgolf

> Dan Palley wrote:

> > How is the server name specified in the alias?  You can't connect via
local
> > interbase from within a service; you have to use localhost:.

> > Dan

> > artgolf <artg...@winning.com> wrote in message
> > news:38D1E43F.F3D86B16@winning.com...
> > > Hi
> > > file://--------------------------------------------
> > >     Database1 := TDatabase.Create(nil);
> > >     Database1.AliasName := 'JXC';
> > >     Database1.Connected := True;
> > > file://--------------------------------------------
> > > Works well in Windows 95/98, when I add to a Windows NT 4.0 Service,
> > > the last line can not work , who can guide me ?
> > > Artgolf

Other Threads