Just curious - Deleting Objects in Access

E

eighthman11

If you delete a Form in Access which has several objects on the form
(i.e. Combo boxes, buttons, text fields) does all the code involved
with those objects and the form get deleted or do you need to to a
decompile to get rid of the garbage?

Thanks for any help.
 
A

Armen Stein

If you delete a Form in Access which has several objects on the form
(i.e. Combo boxes, buttons, text fields) does all the code involved
with those objects and the form get deleted or do you need to to a
decompile to get rid of the garbage?

Thanks for any help.

Deleting a Form also deletes all the controls and code it contained.
However, there is still internal junk left over until you compact the
database.

Armen Stein
Microsoft Access MVP
www.JStreetTech.com
 
T

Tony Toews [MVP]

eighthman11 said:
If you delete a Form in Access which has several objects on the form
(i.e. Combo boxes, buttons, text fields) does all the code involved
with those objects and the form get deleted or do you need to to a
decompile to get rid of the garbage?

Interesting question. I have no idea.

The three circumstances in which I do a decompile are:

1) Display of the initial form takes longer than a second or two.
2) Wield errors.
3) It's been a while (for subjective definition of a while. <smile>)

So I wouldn't worry too much about decompiling every time you delete a
form. But if doing development all day long then at least once a
month.

Tony
 
J

John W. Vinson

Interesting question. I have no idea.

The three circumstances in which I do a decompile are:

1) Display of the initial form takes longer than a second or two.
2) Wield errors.
3) It's been a while (for subjective definition of a while. <smile>)

So I wouldn't worry too much about decompiling every time you delete a
form. But if doing development all day long then at least once a
month.

Tony

Just for the lurkers and others:

KEEP YOUR BACKUPS CURRENT!

I back up before every decompile, just in case. I expect Tony does too.
 
T

Tony Toews [MVP]

John W. Vinson said:
Just for the lurkers and others:

KEEP YOUR BACKUPS CURRENT!

I back up before every decompile, just in case. I expect Tony does too.

Oh yeah. You wouldn't believe how my backup works. Including Ctrl+C
and Ctrl+V every hour or so on the FE MDB while in Windows Explorer.
Then every few days I zip up the "Copy x of .." MDBs and throw the zip
file in an archive folder.

Tony
 
D

David W. Fenton

m:
If you delete a Form in Access which has several objects on the
form (i.e. Combo boxes, buttons, text fields) does all the code
involved with those objects and the form get deleted or do you
need to to a decompile to get rid of the garbage?

Logic tells me that the part of the BLOB that stores the data is
going be marked as unused within the BLOB field where the Access
project is stored. But I don't know if Access is smart enough to not
have to rewrite the whole field in order to mark one delete flag. If
it can't, then there would be no reason to retain the discarded
code. But if it can, then the discarded code won't be deleted until,
well, I don't know when.

The BLOB data is not stored in the system table that holds the
record that the BLOB field is part of -- all that's in the table is
a pointer to the data pages where the BLOB data is stored. So,
likely only the data pages with the data relating to the deleted
object would need to be marked. Perhaps each object gets its own
data page until such time as it grows larger than a single data
page, so the delete would simple mark the data pages allocated for
the object as unused so they can be written over by other data, and
if still not in use, discarded on the next compact.

I don't trust VBA compilation to be smart enough to remove all
references to discarded data pages that hold compiled module code,
so I would always expect a decompile/compact/recompile/compile cycle
to be necessary to be on the safe side.

But I don't very often delete code-bearing objects.

I do decompile fairly regularly as part of the normal development
process, though. I haven't lost a line of code or a corrupted object
in at least 5 years.
 
D

david

In Access 2.0, the form and objects were described in records
in the database, and all you had to do was delete the record and
compact the database.

In Access 95 and 97, the form and objects were described in
records in the database, and in a compiled object in the database.
You needed to compact the database to get rid of the record,
decompile to get rid of the compiled object, and compact to
get rid of unused pages from the compiled object.

In Access 2000 plus, the form and objects are in a compound
document object in the database, and you need to use the VBA
engine (not the database engine) to compact the compound document
and get rid of the record which describes the form, and you need to
decompile to get rid of the compiled object which describes the form.
And then you need to do a compact to get rid of unused pages from
the record which holds the compound document.

(david)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top