编译错误:未定义用户定义的类型 [英] compile error: user-defined type not defined
本文介绍了编译错误:未定义用户定义的类型的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
当我尝试编译此代码时,在 VB6 中出现编译错误未定义用户定义的类型".谁能告诉我我需要做什么来解决这个错误?以下是我收到错误的行:
There is compile error 'user-defined type not defined' I get in VB6 when I was tried to compile this code. Can anybody tell me what I need to do to solve this error? Following is the line for which I got the error:
Public Conn As ADODB.Connection
Public rs As ADODB.Recordset
推荐答案
需要添加对ADO类型库的引用:
You need to add the reference to the ADO type library:
- 打开您的项目.
- 点击项目菜单项,然后选择参考...
- 从可用参考中,选中Microsoft ActiveX 数据对象 n.n 库旁边的框,其中 n.n 是以下之一:
- 6.1 - 如果您希望应用程序仅在 Windows 7 或更高版本上运行
- 2.8 - 如果您希望应用程序在 Windows XP 或更高版本上运行
- Open your project.
- Click the Project menu item, then select References...
- From Available References, check the box next to Microsoft ActiveX Data Objects n.n Library, where n.n is one of the following:
- 6.1 - if you want your application to run only on Windows 7 or later
- 2.8 - if you want your application to run on Windows XP or later
您可能还想查看 参考Visual Basic 6 应用程序中的 ADO 库 来自 ADO 程序员指南.
You may also want to look at Referencing the ADO Libraries In a Visual Basic 6 Application from the ADO Programmer's Guide.
这篇关于编译错误:未定义用户定义的类型的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文