smithvoice.com
 Y'herd thisun? 

“It's better to be unofficial till you get the facts”
-Lt. Columbo



Database (or any file) security trick

TaggedCoding, Database, DotNet

What they don't know won't hurt you

by Smith, published as Tip of the Month in May 1999 Access/VB Advisor Magazine

Rename your mdbs

If you're coding against Jet files for release (retail or corporate) you should be using some form of security to protect your data and your database structure. 

Many coders just give up on the difficulty of implementing Access security via VB and release with no locks at all.  This is silly.

At the very least you should always put a database password on the file and pass the password to the file in your app's connection.  One step beyond this is to encrypt the database, but this can slow performance depending on the size and implementation of your connections.

But there's one last technique that many Jet coders do not take advantage of and it helps out considerably on the human level.  Change the extension of the database file.

Today, Access is a standard tool on most desktops.  Any end user who has Access knows that a file with the *.mdb extension (which automatically gives the file an Access icon) is a JET file.  Seeing this extension is a big flag for them to open Access and try to open your database.  Sure, if you have a password on the entire file, they will have to type the right password in the Access input box ... but in some offices, this is more fun than playing Solitaire <g>.

Changing the extension of the JET file does not hamper your code in any way, you just have to use the fully qualified string in the connections from your app.  But changing the extension makes your database more "low key" and (as long as you don't tell the users about it) they will not be tempted to try to open your file.

(as a side note, simple "access macro viruses" search your computer for files with the *.mdb extension, such simple renegades will ignore your files.)

Logically, don't add your custom extension to the list of file types for Access to automatically open.

Robert Smith
San Francisco, CA



home     who is smith    contact smith     rss feed π
Since 1997 a place for my stuff, and it if helps you too then all the better smithvoice.com