表/ def属性描述属性 [英] Table /def Properties Description property

查看:152
本文介绍了表/ def属性描述属性的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试返回表格的描述值。


尝试做类似这样的事情

 Dim db As DAO.Database 
Dim tbl As DAO.TableDef

Set db = CurrentDb

For each tbl in db.TableDefs
Debug.Print db.TableDefs(tbl.Name).Properties(" Description")。Value
Next tbl

Set tbl = Nothing
Set db = Nothing

我找不到属性错误


附录:我在本地表上尝试了它并且它可以工作,对链接表不起作用


有没有办法获取链接表的description属性中的内容?


谢谢










解决方案

表只有Description属性如果该属性实际已填写,是否为链接表。

例如,系统表,如MSysObj ects没有描述。

所以为了避免错误,插入一行


On Error Resume Next


循环上方。


顺便说一下,db.TableDefs(tbl.Name)相当于tbl,所以你可以改变


  &NBSP;&NBSP; 调试 打印 db TableDefs <跨度> TBL <跨度> <跨度>名称 <跨度>)。 <跨度>属性 <跨度> ( "说明" )。



    调试 打印 tbl 属性 <跨度>"描述" <跨度>) <跨度>值


I am trying to return the description value of a table.

tried doing something like this

Dim db As DAO.Database
Dim tbl As DAO.TableDef

Set db = CurrentDb

For Each tbl In db.TableDefs
    Debug.Print db.TableDefs(tbl.Name).Properties("Description").Value
Next tbl

Set tbl = Nothing
Set db = Nothing

I get property not found error

addendum: I tried it on local table and it works, doesn't work on linked table

is there a way to get what is in the description property for a linked table?

Thanks


解决方案

A table only has a Description property if that property has actually been filled in, whether it is a linked table or not.
For example, the system tables such as MSysObjects don't have a description.
So to avoid the error, insert a line

On Error Resume Next

above the loop.

By the way, db.TableDefs(tbl.Name) is equivalent to tbl, so you can change

    Debug.Print db.TableDefs(tbl.Name).Properties("Description").Value

to

    Debug.Print tbl.Properties("Description").Value


这篇关于表/ def属性描述属性的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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