isladogs
MVP / VIP
- Local time
- Today, 00:12
- Joined
- Jan 14, 2017
- Messages
- 18,816
I have been developing code to search the SQL used in all database items for selected text strings.
I would appreciate any help or guidance in doing this for the code in standard modules
I'm hoping to use this partly to help tidy up some old & poorly designed legacy field names (including spaces, % & ?) in a large database which I inherited and then took over development work. This is currently used by approx 500 staff in several UK schools for over 15 years. It has an Access front end (approx 140MB) with a SQL Server backend (typically up to 1.4GB)
The starting point was a very useful function posted by Guus2005 in the code repository last year:
https://www.access-programmers.co.uk/forums/showthread.php?t=197449&highlight=SearchInQueryDefs2
This code covered forms (including form modules) & queries
I've since expanded this to include SQL in reports / report modules & table field names. So far, so good.
It works very quickly on the above database - e.g. approx 45 seconds to search all these database items. (approx 300 tables, 1200+ queries, 800+ forms, 600 reports) or less than 20 sec if table fields are excluded
See example screengrabs attached:
When I've completed the code, I intend to upload it to the sample databases area for other users.
However, to finish the task, I would now like to extend the search tool to include text strings in all standard modules but am finding this much harder. Despite searching various forums etc, I've been unable to make much progress.
Yes I know I can use add-ins such as V-Tools or just search using the VBE but I'd like to make this a complete package to cover all database items.
As a later step, I may extend this to finding & replacing text strings but dealing with modules is a higher priority
Any help would be much appreciated
I would appreciate any help or guidance in doing this for the code in standard modules
I'm hoping to use this partly to help tidy up some old & poorly designed legacy field names (including spaces, % & ?) in a large database which I inherited and then took over development work. This is currently used by approx 500 staff in several UK schools for over 15 years. It has an Access front end (approx 140MB) with a SQL Server backend (typically up to 1.4GB)
The starting point was a very useful function posted by Guus2005 in the code repository last year:
https://www.access-programmers.co.uk/forums/showthread.php?t=197449&highlight=SearchInQueryDefs2
This code covered forms (including form modules) & queries
I've since expanded this to include SQL in reports / report modules & table field names. So far, so good.
It works very quickly on the above database - e.g. approx 45 seconds to search all these database items. (approx 300 tables, 1200+ queries, 800+ forms, 600 reports) or less than 20 sec if table fields are excluded
See example screengrabs attached:
When I've completed the code, I intend to upload it to the sample databases area for other users.
However, to finish the task, I would now like to extend the search tool to include text strings in all standard modules but am finding this much harder. Despite searching various forums etc, I've been unable to make much progress.
Yes I know I can use add-ins such as V-Tools or just search using the VBE but I'd like to make this a complete package to cover all database items.
As a later step, I may extend this to finding & replacing text strings but dealing with modules is a higher priority
Any help would be much appreciated