Board index » delphi » Services & NT & BDE

Services & NT & BDE

Hello all,

I'm using Delphi 4 to port an existing DB application to run as an NT
service. I've removed all the UI code, and it compiles and works. However,
when run as a service, it does not seem to be able to access the database,
which is done through BDE/ODBC. Has anyone written a service that accesses a
database via BDE (we need BDe for the character translation). If so, can you
provide me with some hints and/or code ?

Many many thanks in advance

Ian C.

P.S. I would appreciate responses cc'd via email as well.

-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/       Search, Read, Discuss, or Start Your Own    

 

Re:Services & NT & BDE


Quote
icorn...@my-dejanews.com wrote in message

<6vcfv9$l9...@nnrp1.dejanews.com>...

Quote
>I'm using Delphi 4 to port an existing DB application to run as an NT
>service. I've removed all the UI code, and it compiles and works. However,
>when run as a service, it does not seem to be able to access the database,
>which is done through BDE/ODBC. Has anyone written a service that accesses
a
>database via BDE (we need BDe for the character translation). If so, can
you
>provide me with some hints and/or code ?

    Is it a security issue?  Keep in mind that by default, services run in
the security context of the local system account (which basically equates to
no security clearance whatsoever).  An easy way to find out is to set the
service to run in the context of a priviledged account and see if it works
then.

-------
You can find me on #Delphi on Newnet (irc.newnet.net)

Re:Services & NT & BDE


In article <6vdcqn$...@sjx-ixn6.ix.netcom.com>,
  "Guy Gajewski" <def...@nospam-myself.com> wrote:

Quote
> icorn...@my-dejanews.com wrote in message
> <6vcfv9$l9...@nnrp1.dejanews.com>...

> >I'm using Delphi 4 to port an existing DB application to run as an NT
> >service. I've removed all the UI code, and it compiles and works. However,
> >when run as a service, it does not seem to be able to access the database,
> >which is done through BDE/ODBC. Has anyone written a service that accesses
> a
> >database via BDE (we need BDe for the character translation). If so, can
> you
> >provide me with some hints and/or code ?

>     Is it a security issue?  Keep in mind that by default, services run in
> the security context of the local system account (which basically equates to
> no security clearance whatsoever).  An easy way to find out is to set the
> service to run in the context of a priviledged account and see if it works
> then.

> -------
> You can find me on #Delphi on Newnet (irc.newnet.net)

I too am having this problem today.  I think this is a BDE configuration
problem, because when running as a service, the calls to connect the database
connections return errors like "Vendor Initialization Failed" for the Oracle
connection, and "Invalid parameter" for my Interbase ODBC connection - though
both connect fine at design time.

-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/rg_mkgrp.xp   Create Your Own Free Member Forum

Re:Services & NT & BDE


Quote
monicasig...@my-dejanews.com wrote:

> In article <6vdcqn$...@sjx-ixn6.ix.netcom.com>,
>   "Guy Gajewski" <def...@nospam-myself.com> wrote:
> > icorn...@my-dejanews.com wrote in message
> > <6vcfv9$l9...@nnrp1.dejanews.com>...

> > >I'm using Delphi 4 to port an existing DB application to run as an NT
> > >service. I've removed all the UI code, and it compiles and works. However,
> > >when run as a service, it does not seem to be able to access the database,
> > >which is done through BDE/ODBC. Has anyone written a service that accesses
> > a
> > >database via BDE (we need BDe for the character translation). If so, can
> > you
> > >provide me with some hints and/or code ?

> >     Is it a security issue?  Keep in mind that by default, services run in
> > the security context of the local system account (which basically equates to
> > no security clearance whatsoever).  An easy way to find out is to set the
> > service to run in the context of a priviledged account and see if it works
> > then.

> > -------
> > You can find me on #Delphi on Newnet (irc.newnet.net)

> I too am having this problem today.  I think this is a BDE configuration
> problem, because when running as a service, the calls to connect the database
> connections return errors like "Vendor Initialization Failed" for the Oracle
> connection, and "Invalid parameter" for my Interbase ODBC connection - though
> both connect fine at design time.

> -----== Posted via Deja News, The Leader in Internet Discussion ==-----
> http://www.dejanews.com/rg_mkgrp.xp   Create Your Own Free Member Forum

Hi,

I have a similar problem with a DLL developed in Delphi 3 which is used to
access a
database from a NT service.  When the service is run from the command line,
everything
runs fine. When started from the services dialog, it just returns that the
process
was terminated.

The problem appears on connect to the database.
From logging I have found that it is the DbiOpenDatabase call in TDatabase.Open
which does not
return, but instead causes the process to be either killed or exited.

Could this be a setup problem? I have been looking around for references to this
kind of
BDE problem, but found nothing.

Regards
Petter Schau

Re:Services & NT & BDE


Quote
Petter Schau wrote: ,
> I have a similar problem with a DLL developed in Delphi 3 which is
> used to
> access a
> database from a NT service.  When the service is run from the command
> line,
> everything
> runs fine. When started from the services dialog, it just returns that
> the
> process
> was terminated.

> The problem appears on connect to the database.
> From logging I have found that it is the DbiOpenDatabase call in
> TDatabase.Open
> which does not
> return, but instead causes the process to be either killed or exited.

> Could this be a setup problem? I have been looking around for
> references to this
> kind of
> BDE problem, but found nothing.

I have a Problem with a service wri{*word*249} in VC++5.It works very well as a
Process, however, when I start it a service,
I get a Message indicating that the exe file has a bad format.

This happens only on my NT, on other machines (NT4, SP 3) it
can be started as a service.
I refreshed the win nt installation on my computer but it did not
help.
Has anybody any idea about that?
Thanks,
Regards:
Tnde

--
Hier arbeiten 166 Millionen Hertz, 64MB, eine Maus und ich
Homepage: www.hp.europe.de/tkriegl

Other Threads