[Last Call] Learn about multicloud storage options and how to improve your company's cloud strategy. Register Now

x
?
Solved

Disable Database Window?

Posted on 2003-10-22
10
Medium Priority
?
390 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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 80 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
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
LVL 8

Accepted Solution

by:
dds110 earned 200 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 80 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

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

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

This article shows how to get a list of available printers for display in a drop-down list, and then to use the selected printer to print an Access report or a Word document filled with Access data, using different syntax as needed for working with …
Instead of error trapping or hard-coding for non-updateable fields when using QODBC, let VBA automatically disable them when forms open. This way, users can view but not change the data. Part 1 explained how to use schema tables to do this. Part 2 h…
In Microsoft Access, learn the trick to repeating sub-report headings at the top of each page. The problem with sub-reports and headings: Add a dummy group to the sub report using the expression =1: Set the “Repeat Section” property of the dummy…
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…

650 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