28
votes

While connecting .net to sybase server I got this error message:

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

This has worked properly before. System DSN with same details work and data connection through vs.net also work.

I am using vs.net 2005.

Any suggestions?

4
I know that this question is old and for vs.net 2005, but I am using Visual Studio 2015 Professional, and I started getting this error in my solution. It was a win32 program that used a 32-bit ODBC user-DSN. Since there was no 64bit Driver avaialble for my database, I had to use 32-bit. When I delete my .sou file (to fix an IDE problem) Visual Studio swapped my build settings back to x64 (and caused this error). The fix, in my case, was simple enough... just re-set the configuration to win32. In the IDE, right click on the Solution Name->change 'Platform' to Win32).david1024

4 Answers

27
votes

If you're working with an x64 server, keep in mind that there are different ODBC settings for x86 and x64 applications. The "Data Sources (ODBC)" tool in the Administrative Tools list takes you to the x64 version. To view/edit the x86 ODBC settings, you'll need to run that version of the tool manually:

%windir%\SysWOW64\odbcad32.exe (%windir% is usually C:\Windows)

When your app runs as x64, it will use the x64 data sources, and when it runs as x86, it will use those data sources instead.

4
votes

I got a similar error, which was resolved by installing the corresponding MySQL drivers from:

http://www.connectionstrings.com/mysql-connector-odbc-5-2/info-and-download/

and by performing the following steps:

  1. Go to IIS and Application Pools in the left menu.
  2. Select relevant application pool which is assigned to the project.
  3. Click the Set Application Pool Defaults.
  4. In General Tab, set the Enable 32 Bit Application entry to "True".

Reference:

http://www.codeproject.com/Tips/305249/ERROR-IM-Microsoft-ODBC-Driver-Manager-Data-sou

0
votes

For anyone coming to this latterly, I was having this problem over a Windows network, and offer an additional thing to check:

Python script connecting would work from commandline on my (linux) machine, but some users had problems connecting - that it worked from CLI suggested the DSN and credentials were right. The issue for us was that the group security policy required the ODBC credentials to be set on every machine. Once we added that (for some reason, the user had three of the four ODBC credentials they needed for our various systems), they were able to connect.

You can of course do that at group level, but as it was a simple omission on the part of one machine, I did it in Control Panel > ODBC Drivers > New

-1
votes

Perform the following steps:

  1. Start the Registry Editor by typing regedit in the Run window.
  2. Select the following key in the registry: HKEY_LOCAL_MACHINE\SOFTWARE\ODBC.
  3. In the Security menu, click Permissions.
  4. Grant Full Permission to the account which is being used for making connections.
  5. Quit the Registry Editor.