编译错误:未定义用户定义类型 [英] compile error: user-defined type not defined

查看:30
本文介绍了编译错误:未定义用户定义类型的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我尝试编译此代码时,我在 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:

  1. 打开您的项目.
  2. 点击Project菜单项,然后选择References...
  3. Available References 中,选中 Microsoft ActiveX Data Objects n.n Library 旁边的框,其中 n.n 是以下之一:
    • 6.1 - 如果您希望您的应用程序仅在 Windows 7 或更高版本上运行
    • 2.8 - 如果您希望您的应用程序在 Windows XP 或更高版本上运行
  1. Open your project.
  2. Click the Project menu item, then select References...
  3. 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

您可能还想查看 参考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屋!

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