?
Solved

How to currupt Access Database???

Posted on 2001-08-03
14
Medium Priority
?
326 Views
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.

Ravikant
0
Comment
Question by:ravininave
[X]
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
14 Comments
 
LVL 3

Expert Comment

by:Joebob
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.
0
 
LVL 15

Expert Comment

by:mohan_sekar
ID: 6349125
Hi,

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

bye

Mohan
0
 

Author Comment

by:ravininave
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.
0
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.

 
LVL 5

Expert Comment

by:dredge
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.
0
 

Author Comment

by:ravininave
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.
0
 
LVL 43

Accepted Solution

by:
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.
0
 

Author Comment

by:ravininave
ID: 6349211
Please tell me in details.  As it seems to be a correct way.
0
 
LVL 4

Expert Comment

by:wileecoy
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.

hth.
0
 
LVL 8

Expert Comment

by:DennisBorg
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
0
 
LVL 7

Expert Comment

by:Z_Beeblebrox
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.

Zaphod.
0
 
LVL 44

Expert Comment

by:Arthur_Wood
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.

 
0
 

Author Comment

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

Expert Comment

by:DanRollins
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
0
 
LVL 5

Expert Comment

by:Netminder
ID: 7213233
Per recommendation, force-accepted.

Netminder
CS Moderator
0

Featured Post

On Demand Webinar: Networking for the Cloud Era

Ready to improve network connectivity? Watch this webinar to learn how SD-WANs and a one-click instant connect tool can boost provisions, deployment, and management of your cloud connection.

Question has a verified solution.

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

Introduction While answering a recent question about filtering a custom class collection, I realized that this could be accomplished with very little code by using the ScriptControl (SC) library.  This article will introduce you to the SC library a…
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.
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
Suggested Courses

777 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