MySQL Forums
Forum List  »  Connector/ODBC

ODBC in Windows Service
Posted by: Stefan Eriksson
Date: January 19, 2012 02:42AM

I have my own Windows service, on my Windows 7 64-bit computer, which uses the MySQL ODBC connection for the service. The service is programmed in C# and uses standard .NET ODBC libraries. I use MySQL 5.5 as my database.

When I run the service in console, to test connection and functionallity to database - the service is not then installed, everything works and data is inserted in my database.

If I install the service with InstallUtil.exe the service cannot connect the ODBC connection to the database when I'm running it. In services.msc application I can see my service is installed as "Local system" in "Log On As" field.

I have googled about this problem and it seems that the service is installed on a diffrent user which is not the same user as the ODBC connection is installed on. Can someone confirm this for me?

In services.msc I can edit the service's properties and set "account settings" to the computer I'm using and user name and password. This will change the "Log On As" field to my user log in. When I now run the service the ODBC connection works just like I want it.

Is there any solution for this?

Options: ReplyQuote


Subject
Written By
Posted
ODBC in Windows Service
January 19, 2012 02:42AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.