VB编译错误用户定义的对象 [英] VB compile error User defined Object

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

问题描述

我在以下代码中遇到编译错误。

我错过了什么

I am getting a Compile error on the following Code.
What have I missed

展开 | 选择 | 换行 | 行号

推荐答案

qry_elabel如下所示。

The qry_elabel is as below.

展开 | 选择 | Wrap | 行号


错误是


"用户定义的类型未定义"并突出显示mydb As数据库。


数据表通过ODBC链接,qry_elabel合并来自各种表的数据,为标签中的每个变量创建文本字符串。


John S
The error is

"User-defined type Not defined" and the mydb As Database is highlighted.

The Data tables are linked via ODBC, the qry_elabel consolidates data from various tables to create text strings for each variable in the label.

John S



错误是


"用户定义的类型未定义并突出显示mydb As数据库。


数据表通过ODBC链接,qry_elabel合并来自各种表的数据,为标签中的每个变量创建文本字符串。


John S
The error is

"User-defined type Not defined" and the mydb As Database is highlighted.

The Data tables are linked via ODBC, the qry_elabel consolidates data from various tables to create text strings for each variable in the label.

John S



确保在参考对话框中定义了正确的类型库,例如Microsoft DAO 3.6对象库,Microsoft ActiveX数据对象2.X库等


显式声明对象所属的类型库,例如

Dim MyDB作为DAO.Database,

Dim MyRS作为DAO.Recordset,

将你的RSS视为ADODB.Recordset等。


希望这有帮助。

Make sure that the proper Type Libraries are defined in the References Dialog, e.g. Microsoft DAO 3.6 Object Library, Microsoft ActiveX Data Objects 2.X Library, etc.

Explicitly Declare the Type Libraries to which Objects belong, e.g.
Dim MyDB As DAO.Database,
Dim MyRS As DAO.Recordset,
Dim YourRS As ADODB.Recordset, etc.

Hope this helps.


这篇关于VB编译错误用户定义的对象的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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