Solved

Disable Database Window?

Posted on 2003-10-22
10
376 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
 
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
Complete VMware vSphere® ESX(i) & Hyper-V Backup

Capture your entire system, including the host, with patented disk imaging integrated with VMware VADP / Microsoft VSS and RCT. RTOs is as low as 15 seconds with Acronis Active Restore™. You can enjoy unlimited P2V/V2V migrations from any source (even from a different hypervisor)

 

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Form button in access 2 37
count unique records in access report 2 23
Like Function in Query Dramatically Increasing Run Time 13 32
Access Excel export not behaving 2 25
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…
I originally created this report in Crystal Reports 2008 where there is an option to underlay sections. I initially came across the problem in Access Reports where I was unable to run my border lines down through the entire page as I was using the P…
Familiarize people with the process of utilizing SQL Server views from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Access…
In Microsoft Access, when working with VBA, learn some techniques for writing readable and easily maintained code.

919 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