Windows Develop Bookmark and Share   
 index > Windows Forms Sample Applications > Windows service databse problem
 

Windows service databse problem

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
--
Taduri

staduri  Thursday, July 19, 2007 5:19 PM
It looks like a credentials problem because of that Login failure. If that VB program uses its own credentials to log in toSQL then it will fail because it's most likely running with the same account as the service. I hope you're not expecting the VB program to be running with the same credentials as the logged-in intercative user.
PhilWilson  Thursday, July 19, 2007 9:41 PM
It will be trying to login to the server with the service's user account. I doubt that will work. ProcessStartInfo.Username and Password could help to start the WF app under a user account that SQL server accepts.
nobugz  Thursday, July 19, 2007 11:10 PM
It looks like a credentials problem because of that Login failure. If that VB program uses its own credentials to log in toSQL then it will fail because it's most likely running with the same account as the service. I hope you're not expecting the VB program to be running with the same credentials as the logged-in intercative user.
PhilWilson  Thursday, July 19, 2007 9:41 PM
It will be trying to login to the server with the service's user account. I doubt that will work. ProcessStartInfo.Username and Password could help to start the WF app under a user account that SQL server accepts.
nobugz  Thursday, July 19, 2007 11:10 PM

You can use google to search for other answers

Custom Search

More Threads

• Where can i get sample applications?
• Occupied Space and cellRadius
• linking
• Reporting service for Terrarium is not working again
• Organism State
• State of Affairs
• Audit Trail using C#.Net - Winforms
• Really? NO Server Package for TaskVision 2.1??
• Stuck at the first code line of the terrarium...
• Forumbug