类型 'dao.DBEngine' 未定义,类型 'dao.Recordset' 未定义,类型 'dao.Workspace' 未定义 VB.NET 2008 至 2010 [英] Type 'dao.DBEngine' is not defined, Type 'dao.Recordset' is not defined, and Type 'dao.Workspace' is not defined VB.NET 2008 to 2010
问题描述
我有一个 VB.NET 项目,我已将其从 Visual Studio 2008 转换为 Visual Studio 2010.在 VS 2008 中,该项目编译并运行得很好.当我将其转换为 VS 2010 时,DAO 对象出现了很多错误.此程序连接到 SQL 数据库而不是 Access 数据库.我检查了 DAO 引用是否已添加到项目中,但它说 系统找不到指定的引用
.
这是我的参考资料的屏幕截图:
代码和错误:
模块升级支持朋友 DAODBEngine_definst 作为新的 dao.DBEngine
<块引用>
错误:未定义类型dao.DBEngine"
Dim r As dao.Recordset
<块引用>
错误:未定义类型dao.Recordset"
Dim selProdODBC As dao.Workspace
<块引用>
错误:未定义类型dao.Workspace"
有人能告诉我我需要做什么才能使我的项目在 Visual Studio 2010 中工作,就像在 Visual Studio 2008 中那样吗?
为了使 DAO 在 Visual Studio 2010 中用作参考,您已将 ACEDAO.DLL 添加到您的项目中.我从我的机器上得到了 .DLL 文件,它在办公室程序文件中.添加 .DLL 文件后,您必须将正确的导入添加到您的项目中.
导入 Microsoft.Office.Interop.Access
I have a VB.NET project that I have converted from Visual Studio 2008 to Visual Studio 2010. In VS 2008 the project compiles and runs just fine. When I converted it to VS 2010, I get a lot of errors with the DAO objects. This program connects to a SQL database not an Access database. I checked that the DAO reference was added in the project, it was but it says the system cannot find reference specified
.
Here is a screen shot of my my references:
The code and the errors:
Module UpgradeSupport
Friend DAODBEngine_definst As New dao.DBEngine
Error: Type 'dao.DBEngine' is not defined
Dim r As dao.Recordset
Error: Type 'dao.Recordset' is not defined
Dim selProdODBC As dao.Workspace
Error: Type 'dao.Workspace' is not defined
Can someone please tell me what I need to do, in order to make my project work in Visual Studio 2010, like it did in Visual Studio 2008?
In order to get DAO to work as a reference in Visual Studio 2010, you have add the ACEDAO.DLL to your project. I got the .DLL file from my machine, it was in the office programs files. Once you add the .DLL file, you will have to add the correct import to your project.
Imports Microsoft.Office.Interop.Access
这篇关于类型 'dao.DBEngine' 未定义,类型 'dao.Recordset' 未定义,类型 'dao.Workspace' 未定义 VB.NET 2008 至 2010的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!