473,388 Members | 1,493 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,388 software developers and data experts.

Searching for DB Objects within an ADP

I inhereted a rather extensive MS Access 2000 database (SQLServer 2000
backend)in adp format.

Is there a way to search the Access front end for references to
specific database objects?

Let's say there are 100 macros and I want to know if any of them use a
particular stored procedure. I'd hate to have to manually look in all
100 macros.

Or, suppose I wanted to see if a stored procedure was used as a
recordsource for any number of 100 or so reports. What's the most
efficient way of doing so?

Thanks for any light you can shed!

Matt
Nov 13 '05 #1
6 1420
"Matt" <mh******@yahoo.com> wrote in message
news:5f*************************@posting.google.co m
I inhereted a rather extensive MS Access 2000 database (SQLServer 2000
backend)in adp format.

Is there a way to search the Access front end for references to
specific database objects?

Let's say there are 100 macros and I want to know if any of them use a
particular stored procedure. I'd hate to have to manually look in all
100 macros.

Or, suppose I wanted to see if a stored procedure was used as a
recordsource for any number of 100 or so reports. What's the most
efficient way of doing so?

Thanks for any light you can shed!

Matt


Does't SQL server show you the object dependancies? Open up the
Enterprise manager and check out the objects properties....
--
regards,

Bradley
Nov 13 '05 #2
"Bradley.-." wrote
Does't SQL server show you the
object dependancies? Open up the
Enterprise manager and check out
the objects properties....


SQL Server is unaware of Access reports, which were the subject of the
question.
Nov 13 '05 #3
"Larry Linson" <bo*****@localhost.not> wrote in message
news:_l******************@nwrddc02.gnilink.net
"Bradley.-." wrote
> Does't SQL server show you the
> object dependancies? Open up the
> Enterprise manager and check out
> the objects properties....


SQL Server is unaware of Access reports, which were the subject of the
question.


That'll teach me for skimming the post ;)
--
regards,

Bradley
Nov 13 '05 #4
Yes, Access projects have an AllReports collection which you can "enumerate"
(loop through... you will have to open each Report in the collection in
Design View, however, to examine the RecordSource). And, remember that there
are multiple ways to specify the same thing: a table name, or an SQL
Statement that retrieves the information (which may refer to one or more
tables, and may retrieve all, or just some, of the fields).

I don't have an example for Reports, but here are pertinent statements from
an example that I used to go through the AllModules collection:

Dim obj1 As AccessObject, dbs1 As Object
Dim mod1 As Module, frm1 As Form

Set dbs1 = Application.CurrentProject

For Each obj1 In dbs1.AllModules
If obj1.Name <> "basDesignTimeCode" Then
If obj1.IsLoaded = True Then
... do something
Else
DoCmd.OpenModule obj1.Name
CurrentObjectType = obj1.Type
CurrentObjectName = obj1.Name
... do something
DoCmd.Close acModule, obj1.Name ', acSaveYes
End If
End If
Next obj1

I find it difficult to imagine anyone using Macros in an Access project. I
certainly don't have any examples using Macros -- an Access project is, by
my definition, a developed application and the only Macro I'd think about
using in a developed application would be AutoKeys. But, surely enough,
there is an AllMacros Collection and decent help on how to use it in Access
2002 (if you're using Access 2003, it may be more difficult to find the help
you need).

Larry Linson
Microsoft Access MVP

Larry Linson
Microsoft Access MVP
"Matt" <mh******@yahoo.com> wrote in message
news:5f*************************@posting.google.co m...
I inhereted a rather extensive MS Access 2000 database (SQLServer 2000
backend)in adp format.

Is there a way to search the Access front end for references to
specific database objects?

Let's say there are 100 macros and I want to know if any of them use a
particular stored procedure. I'd hate to have to manually look in all
100 macros.

Or, suppose I wanted to see if a stored procedure was used as a
recordsource for any number of 100 or so reports. What's the most
efficient way of doing so?

Thanks for any light you can shed!

Matt

Nov 13 '05 #5
Thanks, Larry, for that insight. Your solution is not what I was
expecting, but will work just fine for my needs.
I don't have an example for Reports, but here are pertinent statements from
an example that I used to go through the AllModules collection:
Here is the code I used to enumerate the reports and obtain each
report's recordsource (pardon the adaption of your formatting, I
modified it to match our existing code):

Dim oObj As AccessObject
Dim oProject As Object

Set oProject = Application.CurrentProject

For Each oObj In oProject.AllReports
DoCmd.OpenReport oObj.Name, acViewDesign
Debug.Print "Report: " & oObj.Name
Debug.Print Application.Reports(oObj.Name).RecordSource
DoCmd.Close acReport, obj1.Name
Next oObj
I've actually gone a step further and imported this info into a
SQLServer table, so I can query against it using SQL. You've made my
job here much easier!

I find it difficult to imagine anyone using Macros in an Access project. I
certainly don't have any examples using Macros -- an Access project is, by
my definition, a developed application and the only Macro I'd think about
using in a developed application would be AutoKeys. But, surely enough,
there is an AllMacros Collection and decent help on how to use it in Access
2002 (if you're using Access 2003, it may be more difficult to find the help
you need).


I had to jump thru a few hoops, but used similar code to that above
for the macros and was able to obtain the info I needed.

Hopefully without going to far OT, our database was developed here
over the last 4 or 5 years; the previous developer used quite a few
macros, mostly to export the output of stored procedures to Excel
spreadsheets. I've read that the main reason to avoid macros is
because of error handling. Understood. But using these "OutputTo"
macros is pretty straightforward- if they fail there is no "crash",
just a (rather scary, to the user) message box describing the problem.
But I am open to suggestions. If there is a better means of going
about this, please let me know and I will do some further research.

Thanks again for your help,

Matt
Nov 13 '05 #6
I use VBA code... you can do anything in VBA code that you can do in macros
(except AutoKeys), and you can include error handling. I don't argue that
there are no cases and places where macros can be productively used, but I
use code in all cases, for consistency.

In fact, the code I copied was from an assignment where I was
programmatically adding error handling to over 500 procedures in a large ADP
done by someone else who had omitted error handling -- which omission was
causing the client a good deal of trouble.

Larry Linson
Microsoft Access MVP

"Matt" <mh******@yahoo.com> wrote in message
news:5f**************************@posting.google.c om...
Thanks, Larry, for that insight. Your solution is not what I was
expecting, but will work just fine for my needs.
I don't have an example for Reports, but here are pertinent statements from an example that I used to go through the AllModules collection:


Here is the code I used to enumerate the reports and obtain each
report's recordsource (pardon the adaption of your formatting, I
modified it to match our existing code):

Dim oObj As AccessObject
Dim oProject As Object

Set oProject = Application.CurrentProject

For Each oObj In oProject.AllReports
DoCmd.OpenReport oObj.Name, acViewDesign
Debug.Print "Report: " & oObj.Name
Debug.Print Application.Reports(oObj.Name).RecordSource
DoCmd.Close acReport, obj1.Name
Next oObj
I've actually gone a step further and imported this info into a
SQLServer table, so I can query against it using SQL. You've made my
job here much easier!

I find it difficult to imagine anyone using Macros in an Access project. I certainly don't have any examples using Macros -- an Access project is, by my definition, a developed application and the only Macro I'd think about using in a developed application would be AutoKeys. But, surely enough,
there is an AllMacros Collection and decent help on how to use it in Access 2002 (if you're using Access 2003, it may be more difficult to find the help you need).


I had to jump thru a few hoops, but used similar code to that above
for the macros and was able to obtain the info I needed.

Hopefully without going to far OT, our database was developed here
over the last 4 or 5 years; the previous developer used quite a few
macros, mostly to export the output of stored procedures to Excel
spreadsheets. I've read that the main reason to avoid macros is
because of error handling. Understood. But using these "OutputTo"
macros is pretty straightforward- if they fail there is no "crash",
just a (rather scary, to the user) message box describing the problem.
But I am open to suggestions. If there is a better means of going
about this, please let me know and I will do some further research.

Thanks again for your help,

Matt

Nov 13 '05 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

11
by: thechaosengine | last post by:
Hi all, I have a very general but quite significant question about objects. My question is, when should I create them? I know thats a crap question so let me explain a bit further. Lets...
5
by: David Wender | last post by:
I want to create a dataview with a sort on multiple columns. However, when I use FindRows, I only want to search some of the columns, not all. Is this possible? I have not been able to make it...
33
by: Geoff Jones | last post by:
Hiya I have a DataTable containing thousands of records. Each record has a primary key field called "ID" and another field called "PRODUCT" I want to retrieve the rows that satisy the following...
6
by: AAJ | last post by:
Hi all I have some objects that I add to an ArrayList. Each object is from the same class and has methods etc. Each can be identified by a unique property, in this case PK e.g. PK =1 for...
3
by: Henrik Goldman | last post by:
I have a std::map which consist of time_t as first and an associated class as second: map<time_t, myclass> I would like to do calculations (min and max values) for a set of 'second' for a...
4
by: Jordan S. | last post by:
Using .NET 2.0 (C#) I'm writing a small app that will have a "Person" class that exposes FirstName and LastName properties. At runtime, a "People" collection will be populated with a few thousand...
5
by: justobservant | last post by:
When more than one keyword is typed into a search-query, most of the search-results displayed indicate specified keywords scattered throughout an entire website of content i.e., this is shown as...
14
by: Jess | last post by:
Hello, I learned that there are five kinds of static objects, namely 1. global objects 2. object defined in namespace scope 3. object declared static instead classes 4. objects declared...
2
by: BobLewiston | last post by:
The concept of delegates (references to methods) per se is new to me (although I used function pointers in C years ago), and although the literature acknowledges that there are significant...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.