Access如何使用ADO或DAO获取字段的描述属性(KB)
时间:2005-02-06 01:47 来源:Microsoft 作者:Microsof… 阅读:次
原文:http://support.microsoft.com/?kbid=210314
ACC2000: How to Use ADO or DAO to Retrieve a Field's Description
Article ID | : | 210314 |
Last Review | : | June 24, 2004 |
Revision | : | 1.0 |
This article was previously published under Q210314
Advanced: Requires expert coding, interoperability, and multiuser skills.
This article applies only to a Microsoft access database (.mdb).
This article applies only to a Microsoft access database (.mdb).
On this page
SUMMARY | ||
MORE INFORMATION |
SUMMARY
This article describes two methods you can use to retrieve the field description stored with a field in a table definition. One method shows how to do this with ActiveX Data Objects (ADO) and the other shows how to do this with Data access Objects (DAO).
MORE INFORMATION
Each field has a Description property that you can reference with ADO or DAO. The following examples demonstrates how to return a field's description:
ADO Method
The sample code in this article uses ActiveX Data Objects. For this code to run properly, you need to reference the Microsoft ADO Ext. 2.5 for DDL and Security Library.1. | Start Microsoft access and open the sample database Northwind.mdb. |
2. | Create a new module, and then type the following line in the Declarations section if it is not already there:
|
3. | Type or paste the following procedure:
|
4. | Click Immediate Window on the View menu or press CTRL+G to open the Immediate window. |
5. | To test this function, type the following line in the Immediate window, and then press ENTER:
? GetFieldDesc_ADO("Employees", "EmployeeID") Note that the description for the EmployeeID field is returned. |
DAO Method
NOTE: The sample code in this article uses Microsoft Data access Objects. For this code to run properly, you must reference the Microsoft DAO 3.6 Object Library. To do so, click References on the Tools menu in the Visual Basic Editor, and make sure that the Microsoft DAO 3.6 Object Library check box is selected.1. | Start Microsoft access and open the sample database Northwind.mdb. |
2. | Create a new module, and then type the following line in the Declarations section if it is not already there:
|
3. | Type or paste the following procedure:
|
4. | Click Immediate Window on the View menu or press CTRL+G to open the Immediate window. |
5. | To test this function, type the following line in the Immediate window, and then press ENTER:
? GetFieldDesc_DAO("Employees", "EmployeeID") Note that the description for the EmployeeID field is returned. |
(责任编辑:admin)
顶一下
(0)
0%
踩一下
(0)
0%
相关内容
- ·用DAO或ADO正确访问Access 2000
- ·Access开发网络共享版技巧(多人同时操
- ·access中ADO与DAO格式的区别和写法【总
- ·access执行操作查询的几种方法对比
- ·Access中CurrentDb().Execute 和DoCmd.
- ·[源创技巧]在ACCESS中使用代码来自动创
- ·更新访问权限 (Jet) 数据库中的 40 多
- ·【实例】ADO代码计算余额法
- ·DAO实现的子窗体记录分页显示
- ·分别使用DAO和ADO连接外部数据库和Sql
- ·怎样判断一个表是否存在于数据库中? (D
- ·处理加了密码的MDB文件
- ·谈ADO访问不同数据库的差别
- ·DAO基础(4)
- ·DAO基础(3)
- ·DAO基础(2)
最新内容
推荐内容