.net 错误:[Microsoft][ODBC 驱动程序管理器] 未找到数据源名称且未指定默认驱动程序
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/283460/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
ERROR : [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified
提问by
While connecting .net to sybase server I got this error message:
将 .net 连接到 sybase 服务器时,我收到此错误消息:
[Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified
[Microsoft][ODBC 驱动程序管理器] 未找到数据源名称且未指定默认驱动程序
This has worked properly before. System DSN with same details work and data connection through vs.net also work.
这以前工作正常。具有相同细节的系统 DSN 工作和通过 vs.net 的数据连接也工作。
I am using vs.net 2005.
我正在使用 vs.net 2005。
Any suggestions?
有什么建议?
回答by SqlRyan
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:
如果您使用的是 x64 服务器,请记住 x86 和 x64 应用程序有不同的 ODBC 设置。“管理工具”列表中的“数据源 (ODBC)”工具会将您带到 x64 版本。要查看/编辑 x86 ODBC 设置,您需要手动运行该版本的工具:
%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.
当您的应用程序以 x64 运行时,它将使用 x64 数据源,而当它以 x86 运行时,它将改为使用这些数据源。
回答by Midhun Kumar Singh Alluru
I got a similar error, which was resolved by installing the corresponding MySQL drivers from:
我遇到了类似的错误,通过从以下位置安装相应的 MySQL 驱动程序解决了该错误:
http://www.connectionstrings.com/mysql-connector-odbc-5-2/info-and-download/
http://www.connectionstrings.com/mysql-connector-odbc-5-2/info-and-download/
and by performing the following steps:
并通过执行以下步骤:
- Go to IIS and Application Pools in the left menu.
- Select relevant application poolwhich is assigned to the project.
- Click the Set Application Pool Defaults.
- In General Tab, set the Enable 32 Bit Applicationentry to "True".
- 转到左侧菜单中的 IIS 和应用程序池。
- 选择分配给项目的相关应用程序池。
- 单击设置应用程序池默认值。
- 在“常规”选项卡中,将“启用 32 位应用程序”条目设置为“真”。
Reference:
参考:
http://www.codeproject.com/Tips/305249/ERROR-IM-Microsoft-ODBC-Driver-Manager-Data-sou
http://www.codeproject.com/Tips/305249/ERROR-IM-Microsoft-ODBC-Driver-Manager-Data-sou
回答by Withnail
For anyone coming to this latterly, I was having this problem over a Windows network, and offer an additional thing to check:
对于后来遇到这个问题的人,我在 Windows 网络上遇到了这个问题,并提供了一个额外的检查:
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.
Python 脚本连接可以在我的 (linux) 机器上从命令行工作,但有些用户在连接时遇到问题 - 它从 CLI 工作表明 DSN 和凭据是正确的。我们的问题是组安全策略要求在每台机器上设置 ODBC 凭据。一旦我们添加了它(出于某种原因,用户拥有我们各种系统所需的四个 ODBC 凭据中的三个),他们就可以连接了。
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
您当然可以在组级别执行此操作,但由于这是一台机器的简单遗漏,因此我在 Control Panel > ODBC Drivers > New
回答by user37887
Perform the following steps:
执行以下步骤:
- Start the Registry Editor by typing
regeditin the Run window. - Select the following key in the registry:
HKEY_LOCAL_MACHINE\SOFTWARE\ODBC. - In the Security menu, click Permissions.
- Grant Full Permission to the account which is being used for making connections.
- Quit the Registry Editor.
- 通过
regedit在“运行”窗口中键入来启动注册表编辑器。 - 在注册表中选择以下项:
HKEY_LOCAL_MACHINE\SOFTWARE\ODBC. - 在“安全”菜单中,单击“权限”。
- 向用于建立连接的帐户授予完全权限。
- 退出注册表编辑器。

