[AccessD] ID in MSysObjects

John Colby jcolby at colbyconsulting.com
Sat Nov 1 21:11:36 CST 2003


Here's what I have discovered.

If you build an object. lets say a form.  It is issued a sequential number.
It is issued the LAST sequential number in a series.  If you create another
object, lets say another form.  It is issued the NEXT number in that
sequence.  If you delete the first form created, then add another object
(lets say a form) the new form is issued the LAST sequential number, and a
hole exists where the deleted object was.  If you now delete all objects
back to that hole, the next object created is issued the LAST sequential
number, i.e. it is issued the number of the form that was deleted that
created the hold.

IOW, these IDs are NOT like an autonumber where they just go up.  They
cannot be counted on to be assigned to some object and never reused, in fact
they can be counted on being reused as you add and delete objects.  The next
object created gets the next available number.

What a PITA for my purposes!  In fact, the ID may very well be useless for
my purposes.

My problem:  I create a record in a table of my own design called
MSysTables.  It contains the name of the table and an ID from MSysObjects of
the object that has that ID at this moment.  Now... if the designer renames
the table, MSysObjects correctly updates the same record (same ID) with the
new name.  My intention was to use that ID as a "link back" to my own table
whenever an object was renamed.  However... if a developer DELETES that
object, AND IT IS THE LAST ID IN THE SERIES, when they create the next
object it gets that old ID.  Thus now my ID in my table points to a
completely different object, perhaps not even the same kind.  It could now
be a query or a report!

Holy crap batman, how do I track name changes?


John W. Colby
www.colbyconsulting.com




More information about the AccessD mailing list