[Last Call] Learn about multicloud storage options and how to improve your company's cloud strategy. Register Now


How to currupt Access Database???

Posted on 2001-08-03
Medium Priority
Last Modified: 2012-06-21
Hello All Experts,

I've to currupt Access Database so that no one can open it through MS-ACCESS but again I should be able to aceess the same Database using VB.

Question by:ravininave
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions

Expert Comment

ID: 6349118
If you corrupt the db, it is corrupt to everyone, including VB.  Your only real option is to password protect the db with some long and weird password that your VB app knows, but nobody else will guess.
LVL 15

Expert Comment

ID: 6349125

      I am not clear about your question. Do u wanna password protect your database or encrypt the data?



Author Comment

ID: 6349140
No I don't wish to protect my db with password or I don't mean to currupt it.  I only wish that someone should not open it through Access.
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.


Expert Comment

ID: 6349172
rename it do databasename.DLL instead of databasename.MDB

you'll still be able to open it, but only if you actually know that it's a database instead of a .dll file.

the better way, of course, is to set a password.

Author Comment

ID: 6349187
No I think there is a some way over there.  Because I'd downloaded one Software from NET.  When I tried to open Access Database then It gives me a message that the db is currupted.  But it uses it in his application.  How I don't know.
LVL 43

Accepted Solution

TimCottee earned 200 total points
ID: 6349194
How about this as a possibility, use file functions to open the mdb for binary access, grab say the first 20 characters and store these somewhere like the registry. Rewrite these characters with garbage. Access will then spit out the mdb if you attempt to open it as the header will be corrupt. When you run your application, simply rewrite the original section from the registry and use your application as normal. When the application terminates, write garbage back to the header. It won't prevent access opening the mdb whilst your application has it open (unless your app uses it exclusively) but it will prevent casual attempts to open it with access.

Author Comment

ID: 6349211
Please tell me in details.  As it seems to be a correct way.

Expert Comment

ID: 6349229
Actually, don't know if my $0.02 will make a difference, but I have found that the easiest thing is to follow dredge and just rename the extension.

However, I rename the extension to my initials so that I can easily track all such files.

The structure of the file is still the same, however, Windows and Windows apps (like Access) won't recognize it by it's structure, only by it's extension.


Expert Comment

ID: 6349260
>No I think there is a some way over there.  Because I'd
>downloaded one Software from NET.  When I tried
>to open Access Database then It gives me a message that
>the db is currupted.  But it uses it in his application.
>How I don't know.

Did it say it was corrupt? Or did it say it was an unrecognized database format? That program you downloaded may be using a higher version of the Access database than your copy of Access. For example, you cannot open an Access 2000 database by using MS Access '97. Or, the program may be using a different type of database altogether.

Your objective is to prevent people from opening the database in Access, yet for the database to be still usable by your program.

Your best method of achieving this goal is not to corrupt your database, but rather to either use a database password, or to use user-level security and secure your database.

Adding a password to the database is a very simple solution, and your VB program can simply access the database with the password; and your end-users of your VB program would never even know about the password. It would function exactly as if there were no password on the database because your VB program takes care of it automatically in the programming. Yet, if a user attempts to open the database in Access, they will be prompted for a password and they cannot open it unless they know what that password is.

The downside to using the database password is that it is very easy to break. There are probably about 20 people here who can quite readily explain to you how to do this.

A better approach would be to secure your database, change ownership of all objects to a special user you create, revoke all rights from the Users Group, Admins Group, and the Admin User, and add a password to the Admin User. Give all rights to your special user. Then your VB program would simply open your database under your special user's identity; and again, your users would never know the difference, and they also would not be able to open it in MS Access.

-Dennis Borg

Expert Comment

ID: 6349688
Hi, I like the changing of the header approach, but another possibility is to encrypt the entire database file using some encryption algorithm. This is functionally the same as changing the header, but it is a bit more secure, although the time required might be a bit excessive.

LVL 44

Expert Comment

ID: 6349835
The error message that you are getting may indicate that the MDB you are attempting to open is really Access 2000, and you are trying to open it with Access 97.


Author Comment

ID: 6351216
Hi TimCottee,
I thins yr way is correct.  I'm trying with this.
LVL 49

Expert Comment

ID: 7198468
Hi ravininave,
It appears that you have forgotten this question. I will ask Community Support to close it unless you finalize it within 7 days. I will ask a Community Support Moderator to:

    Accept TimCottee's comment(s) as an answer.

ravininave, if you think your question was not answered at all or if you need help, just post a new comment here; Community Support will help you.  DO NOT accept this comment as an answer.

EXPERTS: If you disagree with that recommendation, please post an explanatory comment.
DanRollins -- EE database cleanup volunteer

Expert Comment

ID: 7213233
Per recommendation, force-accepted.

CS Moderator

Featured Post

Ask an Anonymous Question!

Don't feel intimidated by what you don't know. Ask your question anonymously. It's easy! Learn more and upgrade.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article describes some techniques which will make your VBA or Visual Basic Classic code easier to understand and maintain, whether by you, your replacement, or another Experts-Exchange expert.
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
Suggested Courses

656 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question