Question stop user renaming a accdr to accdb

goodhead

Registered User.
Local time
Yesterday, 18:41
Joined
Feb 18, 2013
Messages
37
I have a database that is saved as an accdr so it can be compiled for distribution as an exe

I have just found the accdr the exe installed and renamed to accrb and was then able to open it and view all the tables, forms etc.

Is there a way to stop this?

Obviously I cant stop someone renaming but if there was a way to stop the forms, tables etc opening.

DG
 
You can use code to check for the extension and close the application when it doesn't match what you expect.
Code:
if StrReverse(split(StrReverse(currentdb.Name),".")(0)) <> "accdr" then docmd.quit
where
Code:
StrReverse(split(StrReverse(currentdb.Name),".")(0))
is just a way to retrieve the filenames extension.

Hide all objects and don't allow users to circumvent the shift-key bypass.

HTH:D
 
even so, why not compile to an accde anyway?
 
The best way to go would be.. ACCDB -> ACCDE -> ACCDR

Doing so, will not allow the design changes to any of the object. On top of this, change the options to hide navigation window and also as Guus2005 has suggested look for Shift Bypass..
 
Do I put this code in the startup form as on load?


You can use code to check for the extension and close the application when it doesn't match what you expect.
Code:
if StrReverse(split(StrReverse(currentdb.Name),".")(0)) <> "accdr" then docmd.quit
where
Code:
StrReverse(split(StrReverse(currentdb.Name),".")(0))
is just a way to retrieve the filenames extension.

Hide all objects and don't allow users to circumvent the shift-key bypass.

HTH:D
 
I assume by now you already tried that? and it worked?
 
@Paul - Doing so, will not allow the design changes to any of the object
The .accde only prevents updates to objects with code - forms/reports/modules. Tables/queries/macros are still fair game.

Renaming the file to .accdr tells Access to pretend to be the runtime engine and so a file with that extension cannot be opened in design view under any circumstances. Of course as the OP has noticed, people are able to overcome that obstacle by renaming the file back to .accde or .accdr.

Keep in mind that all the security suggestions are roadblocks at best. Nothing actually secures your Access app. If you have a problem with internal users, perhaps a memo from your Legal department regarding tampering with company property will put an end to their meddling.
 
Hello Pat,

I might have misread the OP's requirement along with several assumptions.

  • I thought that is what he/she wanted to do, as the internal users change the extension gaining access to the objects.. Doing ACCDB -> ACCDE -> ACCDR; the process of making an ACCDE would compile the objects thus disallowing design changes. Then even if they rename it to ACCDB/E they would not be able to gain access them.
  • I also made an assumption that the DB might be split so design changes to tables would be not possible anyway..
  • Also OP just wanted them not to open the Tables (or anything contained in the Navigation pane) so I proposed Shift Bypass..
However I dis not know Queries could be modified even in a ACCDE :eek: That's something I have learnt today. :) Thank you !
 
If the data base is split (which I always assume is the case) you are correct, you can't modify the tabledef but you can still delete it. Compiling (.accde) is no protection for tables/queries/macros. All can be changed/deleted or in the case of linked tables, just deleted since you can never change linked tables anyway.

I agree. Accde and shift-bypass are the best we can do. I was just trying to correct the impression that objects in an .accde were protected. They are not. And .accdr is simply a trick and is no protection at all.
 

Users who are viewing this thread

Back
Top Bottom