如何通过Access宏进行搜索? [英] How to search through Access macros?
本文介绍了如何通过Access宏进行搜索?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我的Access数据库有一个查询,我怀疑它是由宏或其他查询调用的.有什么方法可以在所有宏和/或查询的代码"上运行查找"以查找文本字符串(在这种情况下为查询名称)?
My Access database has a query which, I suspect, is called by macros or other queries. Is there any way to run a Find on the "code" of all the macros and/or queries, to look for a text string (in this case, the query name)?
推荐答案
这列出了所有表&查询:
this lists all the tables & queries:
SELECT IIf([type] = 5, "Query", "Table") AS [Object type]
,MSysQueries.Flag AS [Query type]
,MSysObjects.NAME
,MSysObjects.Id
,MSysObjects.Type
FROM MSysObjects
LEFT JOIN MSysQueries ON MSysObjects.Id = MSysQueries.ObjectId
GROUP BY IIf([type] = 5, "Query", "Table")
,MSysQueries.Flag
,MSysObjects.NAME
,MSysObjects.Id
,MSysObjects.Type
HAVING (
(
(MSysObjects.NAME) NOT LIKE "~*"
AND (MSysObjects.NAME) NOT LIKE "Msys*"
)
AND (
(MSysObjects.Type) = 1
OR (MSysObjects.Type) = 4
OR (MSysObjects.Type) = 6
OR (MSysObjects.Type) = 5
)
)
ORDER BY IIf([type] = 5, "Query", "Table") DESC
,MSysQueries.Flag
,MSysObjects.NAME;
并且此列表列出了每个对象以及引用该对象的查询:
and this one lists each object and the queries that reference it:
SELECT [~MSys Tables & Queries].NAME AS [Object]
,MSysObjects.NAME AS [Used in query]
FROM [~MSys Tables & Queries]
LEFT JOIN (
MSysQueries LEFT JOIN MSysObjects ON MSysQueries.ObjectId = MSysObjects.Id
) ON [~MSys Tables & Queries].NAME = MSysQueries.Name1
GROUP BY [~MSys Tables & Queries].NAME
,MSysObjects.NAME
ORDER BY [~MSys Tables & Queries].NAME
,MSysObjects.NAME;
我不知道如何以相同的方式搜索宏.另外,我不确定这是否总是会拾取联合查询中使用的对象.
I don't know how to search through Macros the same way. Also, I'm not sure this always picks up objects used in Union queries.
我希望它能给您带来入门的机会.
I hope it gives you a place tro start.
这篇关于如何通过Access宏进行搜索?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文