Windows Service - ERROR [IM002] [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified

Asked

Viewed 5,859 times

6

I have 2 projects (Webforms and Windows Services) in . Netframework 4 that connects to Oracle base via Obdcconnection.

In the Web project I can successfully open the connection...

But in Windows Services the following error is released:

ERROR [IM002] [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified

In English: ERROR [IM002] [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified.

In both projects I am using the following method:

public void testConnectionObdc(string connectionString)
{
   OdbcConnection conn = new OdbcConnection(connectionString);
   conn.Open();
}

1 answer

4

Try to change the permissions that your Windows Service runs, the way it seems that the service is not allowed to access ODBC data sources, you can do this through the Windows service manager (press Winkey+R, type in services.Msc and press enter). In the list of services, search for your service, right-click, in the second tab (Log On), set another account to run this service preferably with administrative permissions to make sure that the problem will be solved if it is allowed. After that, just restart the service.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.