Solved

Disable Database Window?

Posted on 2003-10-22
10
375 Views
Last Modified: 2008-03-10
Hi,

Is there any-way to disable the database window from ever appearing...... I know you can hide it on start-up by going to >>tools >>startup and unchecking display database window.

Basically I have a logon form which appears when the database starts which users have to enter their logon id and Password which verifies there user_level and logs them into the database...... however more experienced users can get around this by checking the display window on startup :(

Is this possible or am I doomed..

Cappytator :)
0
Comment
Question by:CptPicard
10 Comments
 
LVL 32

Expert Comment

by:jadedata
Comment Utility
Hey! CptPicard,

 Let's remember that Access is NOT SQL Server.
 If you've already secured your database, hiding the DB window is as good as it gets.
 The next step would be converting to mde and password protecting the DB.


regards
Jack
0
 
LVL 15

Assisted Solution

by:dbase118
dbase118 earned 20 total points
Comment Utility
http://www.experts-exchange.com/Databases/MS_Access/Q_20702699.html

Check out 1Williams discussion here, you may find it useful.
0
 

Author Comment

by:CptPicard
Comment Utility
Hi jadedata :)

So there's no way around it :( the database window will always appear if users want to see it :( :(

I don't have any-problems with security as I have converted my db to MDE and have disabled the shift function with a module.

It's not really a big problem, the logon form is only used to verify users_level, which the main form uses to see who's connected, and these individuals can easily be kicked by an administrator as long as they've logged on correctly...

If users don't logon correctly and access the main form, when they try loggin of they will get an error message becuase its trying to take a tick out of a field in tbl_Users when in actual fact the user isn't logged in :(  so these are the only problems i can see with that.

Cappytator
0
 
LVL 8

Accepted Solution

by:
dds110 earned 50 total points
Comment Utility
Yes there is a way around it.  It involves a little bit of code and you have to remember to put yourself in a back door.  Here's the code.

'**************** Start Code**********************************************
Sub SetStartupProperties()
    ChangeProperty "StartupForm", dbText, "frmMain"
    ChangeProperty "StartUpMenuBar", dbText, "Your App Name"
    ChangeProperty "StartupShortcutMenuBar", dbText, "Your Shortcut Menu Bar"
    'Hide DB Window
    ChangeProperty "StartupShowDBWindow", dbBoolean, False
    ChangeProperty "StartupShowStatusBar", dbBoolean, True
    ChangeProperty "AllowBuiltinToolbars", dbBoolean, False
    'Turn the Full Menus off so stinking users can't get to the db window
    ChangeProperty "AllowFullMenus", dbBoolean, False
    ChangeProperty "AllowBreakIntoCode", dbBoolean, False
    ChangeProperty "AllowSpecialKeys", dbBoolean, False
    'Turn the shift key off  Need to provide a back door with this property set to true
    ChangeProperty "AllowBypassKey", dbBoolean, False
    ChangeProperty "AllowToolbarChanges", dbBoolean, False
    ChangeProperty "AllowShortcutMenus", dbBoolean, False
    ChangeProperty "AppTitle", dbText, "Your App Name again"
    ChangeProperty "AppIcon", dbText, "C:\YourIcon.ico"
    Application.RefreshTitleBar

End Sub

Public 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:
dbs.Close
Set dbs = Nothing

    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
'********************END CODE********************************************

The back door property can be as simple as a Double Click event on a Label.
EX.
Private Sub Label1_DblClick()
ChangeProperty "AllowBypassKey", dbBoolean, True
Exit Sub

If you don't provide yourself with a back door, you could lock yourself out for good.

0
 
LVL 8

Expert Comment

by:dds110
Comment Utility
BTW

It appears that your biggest problem is the fact that your users can get to the menu options that make the db window properties available.

This line:
ChangeProperty "AllowFullMenus", dbBoolean, False
will fix that too.  I highly recommend custom menus if you need the functionality
0
Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

 

Author Comment

by:CptPicard
Comment Utility
Thx guys, gunna test :)
0
 

Author Comment

by:CptPicard
Comment Utility
dds110, maybe it's just me, but I can't get this to work :(
0
 
LVL 1

Assisted Solution

by:ErnestMcDuff
ErnestMcDuff earned 20 total points
Comment Utility
Captain Picard,

There is a solution to your 'beam me away' problem.

Found it somewhere.
First, I use Office XP, plain VBA, so I needed to look for any tricks as well.

Ok.
First of all disable all Startup options. Put in your Form_Open de lines to disable the Shift-key.
Then add to Form_Open the following:
*****************************************
Option Compare Database

Const SW_HIDE = 0
Const SW_SHOW = 1
Const SW_MIN = 2
Const SW_MAX = 3
Private Declare Function ShowWindow Lib "user32" (ByVal hWnd As Long, ByVal_ mdShow As Long) As Long

Private Sub Form_Open(Cancel As Integer)
    Dim lngReturn As Long
    If Environ("Username") <> "Poli0" Then
        lngReturn = ShowWindow(Application.hWndAccessApp, SW_MIN)
    End If
    DoCmd.Restore
End Sub

Private Sub Form_Close()
    Dim lngReturn As Long
    lngReturn = ShowWindow(Application.hWndAccessApp, SW_SHOW)
    Application.Quit acQuitSaveAll
End Sub
*****************************************
NOTE:
Set the property of your form correct. Set the 'Popup"' to yes, otherwise your form will disappear as well :-))

As you can see in the Form_open I use a check on my logged-in username, just cause I wanna be able to work on the form(s). When I finalize I remove that.

I use the SW_MIN instead of the SW_HIDE cause the SWE_HIDE removes also the button on your taskbar, the form will only be visible with Alt-Tab, and even not in TaskManager.
(BTW if you want to hide your form completely (i.e. do something in the backgruond), this could be usefull)

Ok, hopes this helps.
I am not a IT-expert, just another guy who's trying to find his way in MS-Access (although in general IT for the last 15 years)

Ernest McDuff
0
 
LVL 8

Expert Comment

by:dds110
Comment Utility
Where are you having problems?  Remember to post the code into a new module.  Place the cursor somewhere in the Sub procedure and hit F5.  Let me know.
0
 

Author Comment

by:CptPicard
Comment Utility
thx guys for all your help, finally got it to work.....

dds110.. what does pressing f5 do exactly?

When i previosly pasted the code in a new module i didn't press f5 i just saved it... and nothing happend..... but by pressing F5 it works ?
0

Featured Post

Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

QuickBooks® has a great invoice interface that we were happy with for a while but that changed in 2001 through no fault of Intuit®. Our industry's unit names are dictated by RUS: the Rural Utilities Services division of USDA. Contracts contain un…
A simple tool to export all objects of two Access files as text and compare it with Meld, a free diff tool.
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…
In Microsoft Access, learn how to “cascade” or have the displayed data of one combo control depend upon what’s entered in another. Base the dependent combo on a query for its row source: Add a reference to the first combo on the form as criteria i…

744 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

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now