Type 'dao.DBEngine' is not defined, Type 'dao.Recordset' is not defined, and Type 'dao.Workspace' is not defined VB.NET 2008 to 2010

旧街凉风 提交于 2019-12-11 18:35:05

问题


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?


回答1:


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


来源:https://stackoverflow.com/questions/21195380/type-dao-dbengine-is-not-defined-type-dao-recordset-is-not-defined-and-typ

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!