Oracle 9i & Windows Service Program Error

M

MAL

Hello,

I have 2 classes that work great as a windows app to retrieve and
process data from an Oracle9i db. When I implement them in a Service
program running as Local System, it fails on the .open. I am using
OLEDB for Oracle 9.2.0.4. I have verified the Oracle Client install,
Local Sys' path variable, and followed MSKB article 259959(Debugging
connectivity issues w/ Oracle).

Here is the error:
Error #1
Message: Oracle error occurred, but error message could not be
retrieved from Oracle.
NativeError: 0
Source: Microsoft OLE DB Provider for Oracle
SQLState:

Connection string:
conn.ConnectionString = "Provider=MSDAORA;Persist Security
Info=false;Password=TIGER;User ID=SCOTT;Data Source=DATA1;

Can anyone point me to an example of Oracle DB access in a windows
service program?

Any help is appreciated. Thanks in advance.
 
D

David Browne

MAL said:
Hello,

I have 2 classes that work great as a windows app to retrieve and
process data from an Oracle9i db. When I implement them in a Service
program running as Local System, it fails on the .open. I am using
OLEDB for Oracle 9.2.0.4. I have verified the Oracle Client install,
Local Sys' path variable, and followed MSKB article 259959(Debugging
connectivity issues w/ Oracle).

Here is the error:
Error #1
Message: Oracle error occurred, but error message could not be
retrieved from Oracle.
NativeError: 0
Source: Microsoft OLE DB Provider for Oracle
SQLState:

Connection string:
conn.ConnectionString = "Provider=MSDAORA;Persist Security
Info=false;Password=TIGER;User ID=SCOTT;Data Source=DATA1;

Can anyone point me to an example of Oracle DB access in a windows
service program?

There are several things left out of that article. If the program works in
a desktop app, but not in a service then the problem is one of two things:
Secutiry or Environment.

Security:

A service runs in a different security context. Change the service login to
be your interactive login to test if it is a security issue. If it is, give
the service account rights to the [Oracle Home] directory.


Environment:

Every processes inherits its environment from its parent process. The
parent process for a service is the Service Control Manager. The
environment for the Service Control Manager is a snapshot of the environment
at bootup, and cannot be changed without rebooting.

Several environment variables affect the Oracle Client. Most important is
the PATH. If the [Oracle Home]\bin folder is not in the path, then you
cannot load OCI.DLL.

This one is simple to fix. Make sure the environment is correct in Control
Panel>System> Advanced and then reboot.

David
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top