vb.net Odbc 错误 指定的 DSN 包含架构不匹配?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/14816948/
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

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-17 12:17:26  来源:igfitidea点击:

Odbc Error The specified DSN contains an architecture mismatch?

vb.netodbcdatabase-connection

提问by Price Jones

I have a 64bit Progress OpenEdge 10.2A driver installed. The connection works fine when I set it up in the Data Sources (ODBC) administrator and test it.

我安装了 64 位 Progress OpenEdge 10.2A 驱动程序。当我在数据源 (ODBC) 管理员中设置它并测试它时,连接工作正常。

When I try to connect to it using VB.NET (System.Data.Odbc), I get an error:

当我尝试使用 VB.NET (System.Data.Odbc) 连接到它时,出现错误:

ERROR [IM014][Microsoft][ODBC Driver Manager] The specified DSN contains an architecture mismatch between the Driver and Application.

错误 [IM014][Microsoft][ODBC 驱动程序管理器] 指定的 DSN 包含驱动程序和应用程序之间的体系结构不匹配。

I have tried manually configuring the registry keys to allow access using SysWOW6432. But all this does is cause another error when I try to set up a DSN. I get error #193 from Progress.

我尝试手动配置注册表项以允许使用 SysWOW6432 进行访问。但是当我尝试设置 DSN 时,所有这些都会导致另一个错误。我从 Progress 收到错误 #193。

What else could be causing this issue? From what I can tell, I have the proper driver, and the application through which I am using the VB.NET script is configured properly as well.

还有什么可能导致这个问题?据我所知,我有正确的驱动程序,并且我通过它使用 VB.NET 脚本的应用程序也已正确配置。

Any thoughts?

有什么想法吗?

回答by zhanif

I was investigating a similar issue using a different driver and came across this article: http://www.easysoft.com/support/kb/kb01028.htmlNot sure if it gives you any further help.

我正在使用不同的驱动程序调查类似的问题,并发现这篇文章:http: //www.easysoft.com/support/kb/kb01028.html不确定它是否能给您任何进一步的帮助。

回答by darryl_mc

I came across this same type of issue with System.Data.Odbc trying to connect to a 32-bit DSN on a 64-bit machine (C# though, not VB). I set the target platform to x86 and recompiled the project and that resolved the problem. It appears that if you don't specify the build it will automatically try to connect to the default - 64-bit DSN on a 64-bit machine, 32-bit DSN on a 32-bit machine.

我在 System.Data.Odbc 尝试连​​接到 64 位机器上的 32 位 DSN(不过是 C#,而不是 VB)时遇到了同样类型的问题。我将目标平台设置为 x86 并重新编译项目并解决了问题。看来,如果您不指定构建,它将自动尝试连接到默认设置 - 64 位机器上的 64 位 DSN,32 位机器上的 32 位 DSN。

回答by Meerkalandar

Go to Project Properties
Compile:

转到项目属性
编译:

  • Configuration change to All Configuration
  • 配置更改为所有配置
  • Uncheck Prefer 32-bit
  • 取消选中首选 32 位


  • Re-build and Done!!

    重新构建并完成!!