我可以为我的 64 位应用程序使用 32 位 ODBC 驱动程序吗 [英] Can i use a 32 Bit ODBC Driver for my 64 Bit app

查看:43
本文介绍了我可以为我的 64 位应用程序使用 32 位 ODBC 驱动程序吗的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个生成 ODBC 连接的 Win32 应用程序.我们使用 SQLDriverConnect() 连接它显示一个对话框来选择数据源.在 x64 版本中,对话框显示并提供 2 种不同的 32 位 MS ACCESS 驱动程序.当我选择其中之一时,在 32 位版本中,我会看到一个打开文件对话框来选择一个 .mdb 文件.在 64 位版本中,此时对 SQLDriverConnect() 的调用返回 -1.

I have a Win32 application that makes ODBC-Connections. We connect using SQLDriverConnect() which displays a dialog to select the data source. In the x64-Version the Dialog shows and offers 2 different 32 Bit MS ACCESS Drivers. When i select one of these, in the 32 Bit version i would see a open file dialog to select a .mdb file. In the 64 Bit version the call to SQLDriverConnect() at this point returns with -1.

SQLError() 返回:[Microsoft][ODBC 驱动程序管理器] 未找到数据源名称且未指定默认驱动程序"

SQLError() returns: "[Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified"

通常是否可以从 64 位可执行文件中使用 32 位 ODBC 驱动程序?为什么显示这些驱动程序?据我所知,到目前为止还没有 64 位 MS Access OBDC 驱动程序.我能做什么?

Is it in general possible to use a 32 Bit ODBC Driver from a 64-Bit executable? Why are these driver shown? As far as i can find there is no 64 Bit MS Access OBDC driver so far. What can i do?

推荐答案

你绝对不能混合 32 位应用程序和 64 位驱动程序(反之亦然).

You absolutely cannot mix 32bit application and 64bit driver (or vice-versa).

基本上,ODBC 驱动程序通常是由其父应用程序加载的 dll(windows)或共享对象(linux...).

Basically, an ODBC driver is, typically, a dll (windows) or a shared object (linux...) which is loaded by its parent application.

共享同一进程空间的所有可执行文件、dll 等必须具有相同的位...

All executables, dlls, etc that share the same process space must be the same bit'ness...

这篇关于我可以为我的 64 位应用程序使用 32 位 ODBC 驱动程序吗的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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