Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to Hide Database Window

Status
Not open for further replies.

trpnbillie

Programmer
Oct 8, 2002
28
US
Hi Everyone -
I have an Access database and I would like to prevent the users from viewing/accessing the database window. I have unchecked the start-up "Display Database Window" in the tools and that works. But if the user clicks on SHIFT while opening the database, they can get the database window.

Is there a way to disable that SHIFT? I don't want users to ever access the database window.

THANKS!
 
here is the code that I use:

'an example of how to set db security settings

'Sub SetStartupProperties()
' ChangeProperty "StartupForm", dbText, "switchboard"
' ChangeProperty "StartupShowDBWindow", dbBoolean, False
' ChangeProperty "StartupShowStatusBar", dbBoolean, False
' ChangeProperty "AllowBuiltinToolbars", dbBoolean, False
' ChangeProperty "AllowFullMenus", dbBoolean, True
' ChangeProperty "AllowBreakIntoCode", dbBoolean, False
' ChangeProperty "AllowSpecialKeys", dbBoolean, False
' ChangeProperty "AllowBypassKey", dbBoolean, False

'End Sub

Function ChangeProperty(strPropName As String, varPropType As Variant, varPropValue As Variant) As Integer
Dim dbs As Database, prp As Property
Const conPropNotFoundError = 3270

Set dbs = CurrentDb
On Error GoTo Change_Err
dbs.Properties(strPropName) = varPropValue
ChangeProperty = True

Change_Bye:
Exit Function

Change_Err:
If Err = conPropNotFoundError Then ' Property not found.
Set prp = dbs.CreateProperty(strPropName, varPropType, varPropValue)
dbs.Properties.Append prp
Resume Next
Else
' Unknown error.
ChangeProperty = False
Resume Change_Bye
End If
End Function

I have a form that is password protected. To enable me to show and hide the relevant parts as required.
 
You're going to be hard pressed trying to prevent the user from getting to the database window. Plus, the user can always open a new database and import all of your tables, forms, reports, etc. If you really want to prevent them from getting to your "stuff", you need to set up security for you database (see thread181-461208). You could also save you database as an mde and distribute the mde version to your users. The user will not be able to view you modules, forms, and reports (can view tables, queries, and macros).
 
Thank you very much for your help!

The tables are linked to SQL server, so it's ok if they import the tables into something else. (I just don't want them to update the SQL tables directly - I want them to use the forms only)

I am going to try this code provided - again much thanks!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top