穫取Access數據庫中所有錶或查詢的方法

2017-08-29 08:00:00
zstmtony
原創
2255

1. 使用Dao來穫取

穫取Access數據庫中所有錶列錶

For Each tbl in Currentdb.TableDefs

Msgbox tbl.name

next


穫取Access數據庫中所有查詢列錶

For Each qdf in Currentdb.QueryDefs

Msgbox qdf .name

next



2.使用 繫統錶

穫取Access數據庫中所有錶

SELECT MSysObjects.Name, MSysObjects.Type
FROM MSysObjects
WHERE (((MSysObjects.Type)=1));

穫取Access數據庫中所有查詢

SELECT MSysObjects.Name, MSysObjects.Type
FROM MSysObjects
WHERE (((MSysObjects.Type)=5));


分享