TC said:
Sorry Joan, I did not mean to take that tone. I was actually trying to sound
as non-argumentative as I possibly could! It just goes to show how difficult
it is to communicate accurately, without being face to face.
can
compact it without
Good question! I'm not sure, so I'll check that out this week-end, & post
back on Monday. (Today is Friday where I am).
Let's summarize where we currently are. In this discussion, it's actually
not relevant whether we are discussing a workgroup information file, or a
database that has been created with the CreateDatabase method. I'll call
both of those, a "file".
1) when the file is first created (by the workgroup administrator or by
CreateDatabase), the Access objects do not exist;
2) if you open the file with OpenDatabase, the Access objects are not added;
3) if you compact the file with CompactDatabase, the Access objects are not
added;
4) if you open the file with >Access<, Access immediately creates the Access
objects if they do not already exist.
5) Your question is, what happens if you open >Access< (not the file), then
use the compact option to compact the file. I will check that out.
Cheers,
TC
Hi Joan
I checked this out, wrote a detailed reply, then promptly forgot to bring
the reply to this PC! (I have Access on one PC, the net on others, but
never the twain shall meet...) So here it goes again, from memory.
In Access 97, the extra (Access) objects in question are the MSysModules &
MSysModules2 tables, and the Forms, Reports, Scripts, Modules & SysRel1
containers. (Other versions will be slightly different.)
I've established that when you follow the sequence in (5) above, the extra
Acces objects >are not< added to the file.
That is not what I expected! However, on reflection, it does make sense, for
the following reasons.
When you open a file in the Access UI, Access obviously does not know what
you plan to do with it. You >might< just plan to compact it, but you might
also be planning to do others things: for example, creating new forms. So
Access must ensure that the file is ready for any legal operation. For that
reason, it must add the extra Access objects >now<, if they do not already
exist, before it makes the file available in the UI.
But when you open Access, then use Tools
atabase Utilities:Compact
Database, Access knows that the target database >will not< be opened in the
Access UI, by that particular function. So, there is no compelling need to
add the Access objects yet. I imagine that in this case, Access just calls
dbengine compactdatabase to compact the specified database. And
compactdatabase does not add the Access objects; it would not even know what
those objects >are<.
So, here's my summary as it pertains to compacting workgroup files.
<INFO>
"You can compact a workgroup information file in one of three ways.
(1) Through code, using the CompactDatabase method.
(2) From Access, by opening the file in Access, then using Tools : Database
Utilities : Compact Database.
(3) From Access, by opening Access (not the file), then using Tools :
Database Utilities : Compact Database.
Method (2) will add some unnecessary Access objects to the workgroup file.
These will not cause any problems. However, they do take space within the
file, and they are not required for proper operation of the file. You can
avoid adding these objects, by using method (1) or (3) instead of method
(2).
Note: you can not compact the workgroup file that is currently in use by
Access. Instead, close Access, take a copy of that file, compact the copy,
then rename the old one "out" and the new (compacted) one "in".
</INFO>
Of course, A2k muddies these waters by storing the whole project in one big
blob. This raises issues as to what is compacted: the Jet structures, the
content of the big blob, or both? But regardless of that, the following fact
will never change, in any current or future version of Access, IMO: Access
must add at least one new container to a "raw" Jet database, in order to
store its own information. Opening a "raw" Jet database in the Access UI,
will automatically add those objects. Those objects are only required by
Access. They are not required for the correct operation of a "raw" Jet
database. Examples of "raw" Jet databases include, workgroup information
files, and databases created by the DbEngine CreateDatabase method."
As they say: Alert the Media !!
Cheers,
TC