[AccessD] Looping through code modules

Mark A Matte markamatte at hotmail.com
Mon Apr 7 16:06:39 CDT 2008


Roz,

I have just done some work on this.  When you say "getting the code modules"...do you want to save them as text files, store the text in a memo field, just search for keywords, or something else?

I have found 3 approaches...each has its pros and cons.  My project involved searching an entire list of MDBs from a single mdb.

In no particular order:

1A.  loop through DB.Containers
2A.  set new application  and loop through rapp.VBE.ActiveVBProject.VBComponents
3A.  set new reference ref = References.AddFromFile("C:\Temp\MyNew.mdb") and loop through VBE.VBProjects(ref.Name).VBComponents

I was trying to search the code for a specific string...here are some of the issues I had with the 3 approaches...although I'm not done with my testing.

1A.  This approach seemed useful for exporting or storing code in tables.
2A.  This one was easy to search the code...but it opened each database to do it.
3A.  This one did not open each MDB...but it had an issue with referencing an mdb of an earlier version.

Please let me know if you have specific questions about any of it.

Thanks,

Mark A. Matte






----------------------------------------
> Date: Mon, 7 Apr 2008 15:32:47 +0100
> From: rosalyn.clarke at barclays.com
> To: accessd at databaseadvisors.com
> Subject: [AccessD] Looping through code modules
> 
> Hi all
> 
> Does anyone know if there is a quicker / neater way of getting all the (open
> or closed) code modules in a database than going through the modules, forms
> and reports collections in turn?
> 
> TIA
> 
> Roz
> 
> "DSMP Mission - Building the future of Barclays computing infrastructure.  4K
> customers won in 2007, 10k+ to delight in 2008."
> 
> 
> 
> This e-mail and any attachments are confidential and intended solely for the addressee and may also be privileged or exempt from disclosure under applicable law. If you are not the addressee, or have received this e-mail in error, please notify the sender immediately, delete it from your system and do not copy, disclose or otherwise act upon any part of this e-mail or its attachments.
> 
> Internet communications are not guaranteed to be secure or virus-free.
> The Barclays Group does not accept responsibility for any loss arising from unauthorised access to, or interference with, any Internet communications by any third party, or from the transmission of any viruses. Replies to this e-mail may be monitored by the Barclays Group for operational or business reasons.
> 
> Any opinion or other information in this e-mail or its attachments that does not relate to the business of the Barclays Group is personal to the sender and is not given or endorsed by the Barclays Group.
> 
> Barclays Bank PLC.Registered in England and Wales (registered no. 1026167).
> Registered Office: 1 Churchill Place, London, E14 5HP, United Kingdom.
> 
> Barclays Bank PLC is authorised and regulated by the Financial Services Authority.
> -- 
> AccessD mailing list
> AccessD at databaseadvisors.com
> http://databaseadvisors.com/mailman/listinfo/accessd
> Website: http://www.databaseadvisors.com

_________________________________________________________________
Going green? See the top 12 foods to eat organic.
http://green.msn.com/galleries/photos/photos.aspx?gid=164&ocid=T003MSN51N1653A



More information about the AccessD mailing list