Get Object properties in adp A to dbs B

Privateer

Registered User.
Local time
Today, 16:24
Joined
Aug 16, 2011
Messages
193
I have created a query using the system objects table to populate a temporary table of all the objects in the database, which works great. My problem arises when I try to run this in an access project, the system table does not exist, and it won't let me have a table or query in a project. My quick fix was to import everything from the adp into the accdb and my code worked. But I want a better solution. So I have two questions.

How can I open a project (adp) from my database (accdb) in a workspace or something similar? Assume the path and file name are provided.

Once opened, how can I loop through the tables, queries, forms, reports, modules, and macros, essentially all the objects and get their names, dates, and descriptions.

The descriptions are really another problem. By using tabledefs and querydefs I can get the descriptions for those, but I also want them for forms, modules and reports and there are no "defs" for those. So if you have a trick for this I would welcome it.

Basically anything that shows up in the navigation pane, I want to grab and store in another database table. Maybe I should be asking how the navigation pane gets populated?

As always, any help on this will be greatly appreciated.
 
I don't use ADPs but the way you open an mdb/accdb should be the same way you open an adp. So look into this.

You can get the all three properties from DatabaseObject.Containers("..Object..").Properties("..Property..")
 
Thanks for the suggestion, the properties gets me append, count, delete, and refresh and I need more. So I played around with your suggestion and, using documents, I think I have what I need. Try this in the immediate window on one of your databases.

Application.CurrentDb.Containers("forms").Documents("frmEmployees").Properties("description"). Thanks for pointing me in the right direction.
 
T
Application.CurrentDb.Containers("forms").Documents("frmEmployees").Properties("description"). Thanks for pointing me in the right direction.
That's exactly what I mentioned you should do, replacing "..Object.." with the name of the object (i.e. a form or report) and "..Property.." with the name of the property (e.g. Description or LastModified).

You get Append/Count etc when you do Properties.Count or Properties.Append. It's nothing new.
 
You are correct, sorry, must have been tired last night. What I meant was that after typing the word properties followed by the dot, I got those four options. I did not look closely at your example to realize that I should just type in description; my apologies.

And to clarify, I don't like adps either, but the company has ten or twenty of them and I have to convert them to accdbs so I would like a record of the objects in both the adp and SQL server to prove everything got transferred or linked properly. The problem I am running into is that I can't create tables or queries in projects like geekgirlau does with tbl_Documenter. So I will modify her code to run in my accdb but connect to another database and grab the information.

And thanks for finding that article, it will really help.
 
Last edited:
ADPs make sense though because they are optimised for SQL Server if that's the only db Server you'll want to link to.

That shouldn't be an issue. Create the table in the accdb and save the property values there.
 

Users who are viewing this thread

Back
Top Bottom