Lowell said:
I am using the
dbHiddenObject attribute. I have compacted the MDE file, opened the
compacted
database, and the table "seems" to be there because my app works as
expected.
I've been doing a little research and refreshing my memory about this. As
it turns out, in Jet 3.5 and before -- used by Access 97 and its
predecessors -- tables with the dbHiddenObject attribute set would be
deleted on compact. But in Jet 4.0 -- used by Access 2000, 2002, and
2003 -- they changed that (possibly because so many people were having their
tables unexpectedly deleted). I can't say for sure whether that change was
made in the very first release of Jet 4, or whether it came in a service
pack. I also can't say whether the new database engine used by Access 2007
supports this attribute or how it behaves.
So you can probably get away with hiding your table this way if your
application will only be used with Access 2000, 2002, or 2003, and also with
Access 2007 if it behaves the same way. I still don't recommend it, though.
The dbHiddenObject attribute is intended for internal Jet use and could
conceivably be changed again.
Bear in mind, also, that your table, even hidden, could still be discovered
programmatically. Anyone using VB/VBA and DAO could find it by walking
through the TableDefs collection.
7. My method is somewhat convoluted, so if you have a better idea on
preventing unauthorized access, I would be very interested.
This is not something I've thought a lot about, so I don't have any
meaningful advice to offer. If you're interested, Tony Toews has published
some of his ideas about copy protecting Access applications here:
http://www.granite.ab.ca/access/demo.htm
I haven't worked through those ideas, either.