当安装程序未创建标准 DSN 时,如何在 64 位 Server 2008 上使用 32 位 ODBC 驱动程序? [英] How do I use a 32-bit ODBC driver on 64-bit Server 2008 when the installer doesn't create a standard DSN?

查看:31
本文介绍了当安装程序未创建标准 DSN 时,如何在 64 位 Server 2008 上使用 32 位 ODBC 驱动程序?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在使用某些第三方软件时遇到了问题,我们使用这些软件来跟踪计算机实验室中的软件许可证使用情况.我们最近将应用程序迁移到 64 位 Server 2008,在收到公司保证它是兼容的并运行了一些初步测试后,表明该应用程序可以在 64 位环境中运行.不幸的是,进行测试的人没有测试我拥有的几个应用程序的功能,这些应用程序依赖访问数据对数据进行实时和后处理以生成一些报告.

I ran into an issue with some third party software that we use to track software license usage in our computer labs. We recently migrated the app to 64-bit Server 2008 after receiving assurances from the company that it was compatible and running some preliminary tests that showed that the app worked in the 64-bit environment. Unfortunately the person doing the testing didn't test the functionality of a couple of apps that I have that rely on accessing the data to do both live- and post-processing on the data to produce some reports.

事实证明,该应用程序没有 64 位 ODBC 驱动程序来访问其内部数据,并且无法使用 64 位 SQL Server ODBC 驱动程序将其数据导出到 SQL Server.它确实包含并安装了 32 位 ODBC 驱动程序,但它将其安装为用户数据源,而不是系统数据源,这意味着我运行实时集合的 Windows 服务无法找到它.我也无法创建系统 DSN,因为数据源管理控制台找不到安装的驱动程序.

Turns out that the application doesn't have a 64-bit ODBC driver to access its internal data and can't use a 64-bit SQL Server ODBC driver to export its data to SQL server. It does include and install a 32-bit ODBC driver, but it installs it as a User Data Source, not a System Data Source, meaning that my windows service that runs the live collection isn't able to find it. I'm also not able to create a System DSN since the Data Sources admin console can't find the installed driver.

我的问题是如何为这个连接配置一个数据源,我可以从在系统帐户下运行的 C#/.NET Windows 服务访问它?

My question is how do I configure a data source for this connection that I can access from a C#/.NET windows service running under a system account?

既然我已经找到了一种方法,我将提供我的解决方案作为答案(与常见问题解答一致)关于如何回答你自己的问题).

Since I've figured out a way to do it, I'll provide my solution as an answer (in keeping with the FAQ on how to answer your own question).

类似于:有什么软件可以将 64 位 ODBC 应用程序桥接到 Windows 上的 32 位 ODBC 驱动程序?

推荐答案

事实证明,您可以使用 C:WindowsSysWOW64odbcad32.exe 创建 32 位 ODBC 连接.我的解决方案是创建 32 位 ODBC 连接作为系统 DSN.这仍然不允许我连接到它,因为 .NET 无法查找它.在寻找如何让 OdbcConnection 类在正确位置中查找 DSN 进行了大量但毫无结果的搜索之后,我偶然发现了一个建议修改注册表以解决​​不同问题的网站.

It turns out that you can create 32-bit ODBC connections using C:WindowsSysWOW64odbcad32.exe. My solution was to create the 32-bit ODBC connection as a System DSN. This still didn't allow me to connect to it since .NET couldn't look it up. After significant and fruitless searching to find how to get the OdbcConnection class to look for the DSN in the right place, I stumbled upon a web site that suggested modifying the registry to solve a different problem.

我最终直接在 HKLMSoftwareODBC 下创建了 ODBC 连接.我查看了 SysWOW6432 密钥以找到使用 32 位版本的 ODBC 管理工具设置的参数,并在标准位置重新创建了它.但是,我没有为驱动程序添加条目,因为该应用程序的标准安装程序也未安装该条目.

I ended up creating the ODBC connection directly under HKLMSoftwareODBC. I looked in the SysWOW6432 key to find the parameters that were set up using the 32-bit version of the ODBC administration tool and recreated this in the standard location. I didn't add an entry for the driver, however, as that was not installed by the standard installer for the app either.

(手动)创建条目后,我启动了我的 Windows 服务,一切都很愉快.

After creating the entry (by hand), I fired up my windows service and everything was happy.

这篇关于当安装程序未创建标准 DSN 时,如何在 64 位 Server 2008 上使用 32 位 ODBC 驱动程序?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆