Find a table when you know the name of a column?

后端 未结 2 1568
攒了一身酷
攒了一身酷 2020-12-19 05:27

I have a DB in Access with an incredible amount of tables. Unfortunately, the creator used very non-descriptive names, so it\'s basically impossible to even guess what a tab

2条回答
  •  旧巷少年郎
    2020-12-19 06:17

    There is a way to find all the tables having a particular column name, but it requires some code (as opposed to being able just to run a query).

    First you need to make the system tables "visible" in the database. You don't mention which version of MS Access is being used, but the Option dialog should allow something along these lines.

    This exposes the table MSysObjects which contains all the user table names.

    You would presumbably want to iterate through all the user tables, passing there names into some code that opens the tables as DAO.TableDef objects and examines the attributes of the corresponding Fields collection.

    Allen Browne has some VBA code that displays these attributes. You can customize this to your needs.

提交回复
热议问题