Windows service Database Problem

G

Guest

Hi,

I am creating a windows service in C#, it just opens an exe file that was
developed in VB, the exe file having a GUI and connects to DB using system
DSN (using login details sa/master)

I am using code:

Process p;
string FilePath = @"C:\vb_file.exe ";
string arg = " /send";
p = Process.Start(FilePath, arg);


Note : Service Interactiing with Desktop option is selected

Once I started service and checked Event Viewer -> Application log ..it is
showing below error...

Event Type: Error
Event Source: VBRuntime
Event Category: None
Event ID: 1
Date: 7/13/2007
Time: 9:33:41 AM
User: N/A
Computer: xxxx
Description:
The VB Application identified by the event source logged this Application
vb_file: Thread ID: 2704 ,Logged:
vb_file Rev. 30-Apr-03T /send /RESTART
ODBC condition 18456, State=28000, RetCode=-1
28000: [Microsoft][ODBC SQL Server Driver][SQL Server]Login failed for user
'sa'.

But If I do.... Start -> Run and

C:\vb_file.exe /send

it is working and displaying GUI....and not throwing any error...

Please help...

Thanks
 
F

Frank Hickman

Taduri said:
Hi,

I am creating a windows service in C#, it just opens an exe file that was
developed in VB, the exe file having a GUI and connects to DB using system
DSN (using login details sa/master)

I am using code:

Process p;
string FilePath = @"C:\vb_file.exe ";
string arg = " /send";
p = Process.Start(FilePath, arg);


Note : Service Interactiing with Desktop option is selected

Once I started service and checked Event Viewer -> Application log ..it is
showing below error...

Event Type: Error
Event Source: VBRuntime
Event Category: None
Event ID: 1
Date: 7/13/2007
Time: 9:33:41 AM
User: N/A
Computer: xxxx
Description:
The VB Application identified by the event source logged this Application
vb_file: Thread ID: 2704 ,Logged:
vb_file Rev. 30-Apr-03T /send /RESTART
ODBC condition 18456, State=28000, RetCode=-1
28000: [Microsoft][ODBC SQL Server Driver][SQL Server]Login failed for
user
'sa'.

But If I do.... Start -> Run and

C:\vb_file.exe /send

it is working and displaying GUI....and not throwing any error...

Please help...

Thanks

Most likely due to the VB app being launched from a non-user, i.e. service,
account. Try to setup the service to either run as a local account or check
into the impersonation APIs.

--
============
Frank Hickman
NobleSoft, Inc.
============
Replace the _nosp@m_ with @ to reply.
 

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