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

3

I have 2 projects (WebForms and Windows Services) in .NetFramework 4 that connects to the Oracle database through ObdcConnection.

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

However in Windows Services the following error is thrown:

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'm using the following method:

public void testConnectionObdc(string connectionString)
{
   OdbcConnection conn = new OdbcConnection(connectionString);
   conn.Open();
}
    
asked by anonymous 29.08.2014 / 00:11

1 answer

2

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

    
02.09.2014 / 19:45