UtterAccess.com
X   Site Message
(Message will auto close in 2 seconds)

Welcome to UtterAccess! Please ( Login   or   Register )

Custom Search
 
   Reply to this topicStart new topic
> Preventing Modifications wtih .ACCDe    
 
   
TomMcCauley
post Dec 5 2007, 12:31 AM
Post#1



Posts: 76
Joined: 8-March 07



Argh! Microsoft is making things really hard. I have finalized my project and am in the testing phase. Have followed everyone's GREAT suggestions about securing the SHIFT key, etc., etc. Found a great link by Allen Browne here: http://allenbrowne.com/ser-69.html that tells you how to disable some common things people will try to do (switch from tabbed interface to overlapping or vice-versa) and that worked GREAT on my .accdb. However, these changes don't follow when I convert to .ACCDE. The end user is still able to go to the Access options, and change options I would like to prevent them from changing. I know "security" is used very lightly by MS with Access 07. Has anyone been successful in using this code from Allen when converted to an .ACCDE. I have tried both entering the code into the .ACCDB and then converting, as well as converting to .ACCDE first and then entering the code into the VB Immediate window and no luck either way. I'm still reviewing some documents I've come across but if anyone has any ideas I'd appreciate it. I think starting this project in 07 was a mistake. Shame on me.
Go to the top of the page
 
alancossey
post Dec 5 2007, 02:38 AM
Post#2



Posts: 545
Joined: 26-September 05
From: Norfolk, UK


Tom,
To stop a user from getting into Access options, you need to disallow the use of full menus. The code I use is (as used from another database)
Set db = OpenDatabase(TheDatabaseToBeSecured)

ChangeProperty db, "AllowBypassKey", dbBoolean, False
ChangeProperty db, "StartupShowDBWindow", dbBoolean, False
ChangeProperty db, "AllowBreakIntoCode", dbBoolean, False
ChangeProperty db, "AllowBuiltinToolbars", dbBoolean, False
ChangeProperty db, "AllowSpecialKeys", dbBoolean, False
ChangeProperty db, "AllowFullMenus", dbBoolean, False
where ChangeProperty is
Function ChangeProperty(DatabaseToChange As DAO.Database, strPropName As String, _
varPropType As Variant, varPropValue As Variant) As Boolean
On Error GoTo Handler
Dim db As DAO.Database
Dim prp As DAO.Property
Const conPropNotFoundError = 3270
DatabaseToChange.Properties(strPropName) = varPropValue
ChangeProperty = True
ExitHere:
Exit Function
Handler:
Select Case Err.Number
Case conPropNotFoundError ' Property not found.
Set prp = DatabaseToChange.CreateProperty(strPropName, _
varPropType, varPropValue)
DatabaseToChange.Properties.Append prp
Resume Next
Case Else
' Unknown error.
ChangeProperty = False
Resume ExitHere
End Select
End Function
Remember that since you are able to change these properties to False someone else can change them to True using the same code.
Go to the top of the page
 
TomMcCauley
post Dec 5 2007, 10:45 AM
Post#3



Posts: 76
Joined: 8-March 07



Perfect...thanks SO much. I really appreciate the experts here being willing to share their expertise. I realize that someone with this code and just "undo" my work, but at least it's one more hurdle. Again, with the expectation that I'll avoid 90 - 95% of the problems and the other 5%, well, that's just Access.
Go to the top of the page
 
alancossey
post Dec 5 2007, 11:08 AM
Post#4



Posts: 545
Joined: 26-September 05
From: Norfolk, UK


My pleasure. You won't be surprised to learn I got it of someone else.....
Go to the top of the page
 
sfinlay
post Dec 5 2007, 11:43 AM
Post#5



Posts: 69
Joined: 12-September 07



Hi
Would this also stop an end user getting to access options through right clicking on the top of the ribbon (where the tabs are located) and then choosing "customize Quick Access Toolbar" ?
Go to the top of the page
 
alancossey
post Dec 5 2007, 12:13 PM
Post#6



Posts: 545
Joined: 26-September 05
From: Norfolk, UK


Yes, it seems to have that effect on the database I just tried. Requiring the use of the runtime (e.g. by only installing the runtime version of Access 2007 on the user's PC and/or changing the file suffix to .accdr and/or them launching the database with the "/runtime switch" and then checking with start up code in the database itself) would be another way of doing it, I think.
Go to the top of the page
 
ClintC
post Dec 6 2007, 01:50 AM
Post#7


Microsoft Corp UA VIP
Posts: 205
Joined: 5-August 03
From: Redmond, WA


If you want to disable the Access Options icon it can be done with a little XML
<commands>
<command idMso="ApplicationOptionsDialog" enabled="false"/>
</commands>
Go to the top of the page
 
TomMcCauley
post Dec 6 2007, 08:46 AM
Post#8



Posts: 76
Joined: 8-March 07



This code would be put in with code for a custom ribbon, correct?
Go to the top of the page
 
TomMcCauley
post Dec 6 2007, 09:44 AM
Post#9



Posts: 76
Joined: 8-March 07



And as a follow up question, is there a similar way to disable the Print Preview ribbon?
Go to the top of the page
 
TomMcCauley
post Dec 6 2007, 09:48 AM
Post#10



Posts: 76
Joined: 8-March 07



Never mind...was asleep at the wheel and forgot this would just be creating a custom ribbon and entering the property for the report. My bad.
Cheers!
Go to the top of the page
 


Custom Search
RSSSearch   Top   Lo-Fi    16th December 2017 - 06:03 AM