DAO 可以访问当前 Sql Server 版本中的架构吗?
我们维护一个用 VB6 编写的应用程序,并使用史前 DAO 技术来进行数据库访问。数据库位于 Sql Server 2008 中。
我们现在正在编写一个新模块,我想在逻辑上将其与其自己的架构分开。然而,当我尝试编写一个简单的选择查询时,例如:
SELECT ROWID, NAME FROM Exports.TYPES ORDER BY NAME
DAO 抱怨:
Error # 3024
Couldn't find file 'C:\Program Files\Microsoft Visual Studio\VB98\exports.mdb'.
很明显,DAO 正在将架构解释为不同的数据库...是有什么办法告诉它只将查询传递到 Sql Server 吗?
该应用程序根本不使用 Access,仅使用 DAO 库。
We have an app we maintain which is written in VB6 and uses the prehistoric DAO technology to do its database access. The database is in Sql Server 2008.
We are writing a new module now, that I wanted to logically separate off with its own schema. However when I try to write a simple select query like:
SELECT ROWID, NAME FROM exports.TYPES ORDER BY NAME
DAO is complaining:
Error # 3024
Couldn't find file 'C:\Program Files\Microsoft Visual Studio\VB98\exports.mdb'.
So clearly, DAO is interpreting the schema as a different database... is there any way to tell it to just pass the query through to the Sql Server?
This app is NOT using Access at all, just the DAO libraries.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
呃……在谷歌搜索了半个小时后,最后决定发布一个问题,然后我又尝试谷歌搜索并找到答案。哎呀!我讨厌发生这种事!
无论如何,这是为将来可能需要的人提供的答案。
我必须将我的
OpenRecordset
语句从以下位置更改为:
答案来自此知识库文章在 ms.com 上。
Grrr... after googling for a half-an-hour, and then finally deciding to post a Q, then I try one more google and find the answer. Sheesh! I hate when that happens!
Anyway, here is the answer for those who may need it in the future.
I had to change my
OpenRecordset
statement from this:to this:
Answer is from this KB on ms.com.