Results 1 to 9 of 9
  1. #1
    GraeagleBill's Avatar
    GraeagleBill is offline Experienced Old Geezer
    Windows 10 Access 2013 32bit
    Join Date
    Feb 2011
    Posts
    1,919

    DB code and objects

    Albert Kallal created a DB years ago for A97 that counted all the lines of code in a DB plus reporting the number of objects, modules, forms, queries, etc.. Has anyone created a more current version of that functionality? Colin has an object listing app and I see lines of code counters on the net, but not an app that does the whole job like Albert's did. While I still have a copy of Albert's old mdb, A2013 won't open it wherein perhaps it could be updated.

  2. #2
    Micron is offline Virtually Inert Person
    Windows 10 Access 2016
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    12,801
    Not me, but object count seems easy enough if you have to roll your own:
    https://www.devhut.net/count-of-the-...cess-database/

    http://allenbrowne.com/vba-CountLines.html
    The more we hear silence, the more we begin to think about our value in this universe.
    Paraphrase of Professor Brian Cox.

  3. #3
    GraeagleBill's Avatar
    GraeagleBill is offline Experienced Old Geezer
    Windows 10 Access 2013 32bit
    Join Date
    Feb 2011
    Posts
    1,919
    Yes, I did see Allen's LOC counter.
    DevHut link looks promising, but not the line "Currentproject.AllModules.Count 'does not include object modules". In my case, the preponderance of my forms and reports have modules so I can simply report accordingly.

  4. #4
    Micron is offline Virtually Inert Person
    Windows 10 Access 2016
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    12,801
    What is the poster's definition of "object modules", custom classes? Anyway, the documentation I found makes no mention of this.

    https://learn.microsoft.com/en-us/of...ess.allmodules

    I guess the thing to do would be to test and compare the count with what you have.
    The more we hear silence, the more we begin to think about our value in this universe.
    Paraphrase of Professor Brian Cox.

  5. #5
    GraeagleBill's Avatar
    GraeagleBill is offline Experienced Old Geezer
    Windows 10 Access 2013 32bit
    Join Date
    Feb 2011
    Posts
    1,919
    I ran a combination of the what the Devhut posted plus Allen's code:
    18,358 total LOC All modules (general, class and forms/reports)
    52 tables
    144 queries
    64 forms
    28 reports
    75 general modules

    Everything comes out in the IW. Maybe if I can find some time to play, I'll create a little app similar to what Colin likes to do and post it.

  6. #6
    isladogs's Avatar
    isladogs is offline MVP / VIP
    Windows 10 Office 365
    Join Date
    Jan 2014
    Location
    Somerset, UK
    Posts
    5,977
    You didn't provide details/links so I'm not sure what Albert's code did that mine doesn't: Database Statistics (isladogs.co.uk)

    Click image for larger version. 

Name:	Capture2.PNG 
Views:	10 
Size:	17.6 KB 
ID:	49827

    If you're eagle eyed you may spot an issue in the above screenshot....which I intend to fix at some point

    I recently did a modified version for a different article: Access Specification issues (isladogs.co.uk)
    That includes code to create a count of all code modules:

    Click image for larger version. 

Name:	Capture.PNG 
Views:	10 
Size:	44.5 KB 
ID:	49826

    I would be VERY surprised if you really have 18,358 code modules as the 5450 figure was the limit I reached in testing (A365 32-bit). Possibly different in 64-bit Access. YMMV

    You may have 18358 modules, forms & reports but many of those forms & reports will, I expect, have no code module
    Colin, Access MVP, Website, email
    The more I learn, the more I know I don't know. When I don't know, I keep quiet!
    If I don't know that I don't know, I don't know whether to answer

  7. #7
    GraeagleBill's Avatar
    GraeagleBill is offline Experienced Old Geezer
    Windows 10 Access 2013 32bit
    Join Date
    Feb 2011
    Posts
    1,919
    I just posted what Allen posted in the IW. The summary lines:
    7108 line(s) in 76 stand-alone module(s)
    10094 line(s) in 64 module(s) behind forms
    1311 line(s) in 26 module(s) behind reports
    18513 line(s) in 166 module(s)

    I will download your app later this aftrnoon and run a comparison.

  8. #8
    isladogs's Avatar
    isladogs is offline MVP / VIP
    Windows 10 Office 365
    Join Date
    Jan 2014
    Location
    Somerset, UK
    Posts
    5,977
    18000+ code lines. Not code modules.
    What is IW?
    Colin, Access MVP, Website, email
    The more I learn, the more I know I don't know. When I don't know, I keep quiet!
    If I don't know that I don't know, I don't know whether to answer

  9. #9
    GraeagleBill's Avatar
    GraeagleBill is offline Experienced Old Geezer
    Windows 10 Access 2013 32bit
    Join Date
    Feb 2011
    Posts
    1,919
    Sorry, Allen writes the stats to the Immediate Window.

    Your module reveals similar stats:
    Click image for larger version. 

Name:	TMS-Stats.jpg 
Views:	9 
Size:	99.3 KB 
ID:	49828

Please reply to this thread with any new information or opinions.

Similar Threads

  1. I do not see the objects
    By konneof in forum Reports
    Replies: 2
    Last Post: 10-16-2020, 09:25 AM
  2. Replies: 3
    Last Post: 06-23-2020, 10:37 PM
  3. Replies: 6
    Last Post: 03-28-2019, 09:41 AM
  4. OLE Objects
    By BrianF in forum Import/Export Data
    Replies: 3
    Last Post: 04-26-2013, 04:11 PM
  5. query objects in VB6
    By genesis in forum Access
    Replies: 1
    Last Post: 07-10-2009, 02:16 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums