Solved

Disable Database Window?

Posted on 2003-10-22
10
377 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
ID: 9598670
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
ID: 9598810
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
ID: 9598844
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
Back Up Your Microsoft Windows Server®

Back up all your Microsoft Windows Server – on-premises, in remote locations, in private and hybrid clouds. Your entire Windows Server will be backed up in one easy step with patented, block-level disk imaging. We achieve RTOs (recovery time objectives) as low as 15 seconds.

 
LVL 8

Accepted Solution

by:
dds110 earned 50 total points
ID: 9599270
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
ID: 9599291
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
 

Author Comment

by:CptPicard
ID: 9599976
Thx guys, gunna test :)
0
 

Author Comment

by:CptPicard
ID: 9600627
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
ID: 9612484
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
ID: 9619893
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
ID: 9625964
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

Three Reasons Why Backup is Strategic

Backup is strategic to your business because your data is strategic to your business. Without backup, your business will fail. This white paper explains why it is vital for you to design and immediately execute a backup strategy to protect 100 percent of your data.

Question has a verified solution.

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

Regardless of which version on MS Access you are using, one of the harder data-entry forms to create is one where most data from previous entries needs to be appended to new records, especially when there are numerous fields and records involved.  W…
It’s been over a month into 2017, and there is already a sophisticated Gmail phishing email making it rounds. New techniques and tactics, have given hackers a way to authentically impersonate your contacts.How it Works The attack works by targeti…
Learn how to number pages in an Access report over each group. Activate two pass printing by referencing the pages property: Add code to the Page Footers OnFormat event to capture the pages as there occur for each group. Use the pages property to …
With Microsoft Access, learn how to specify relationships between tables and set various options on the relationship. Add the tables: Create the relationship: Decide if you’re going to set referential integrity: Decide if you want cascade upda…

823 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