Locking Database

Rookie2007

New member
Local time
Today, 18:43
Joined
Dec 6, 2007
Messages
9
Hello,

As my username states, I am a rookie to MS Access. I built a database using Access 2002, I will distributed it to other people, I will like to lock changes to certain areas such as forms, design view, etc.

Can this be done? The help is greatly appreciated!

Rookie2007
 
If you want to keep form, report, macro, and VBA changes from occurring, you can create an MDE file and that will do that. Users with a full version of Access could still modify tables or queries.
 
Thanks Bob!

I was afraid of that. I remember downloading a sample database to the full version of MS Access, when I tried to view it in design view it was locked. How did they do that?

Thanks once again!

Rookie2007
 
Help with Access 07 Dev Edition

If you want to keep form, report, macro, and VBA changes from occurring, you can create an MDE file and that will do that. Users with a full version of Access could still modify tables or queries.

Hi Bob,
I installed the free Access 07 developer edition, I made an ACCDE (since Access07 does not support MDE) out of the DB, when I open the ACCDE my event handlers are not able to run?

Any suggestions?

Thanks,

Rookie07
 
You have to have it in a trusted location. If you have set your trusted locations within your ACCDB then it should be fine. If you have not set your trusted locations then you must do it like this:

http://www.btabdevelopment.com/main...owtoenablecodeandmacros/tabid/57/Default.aspx

or like this (from TheScripts forum):

The security system changed in A2007.
You have to determine a Trusted Location (folder) for your accdb.
In full version that's done by adding the place to a list under Access
options. Runtime has no office menu button. So you have to add the folder to
the registry manually adding a locations key, e.g.:

[HKEY_CURRENT_USER\Software\Microsoft\Office\12.0\A ccess\Security\Trusted
Locations\Location1]
AllowSubFolders (REG_DWORD) = 1
Path (REG_SZ) "C:\MyTrustedDatabaseFolderNo1"

[HKEY_CURRENT_USER\Software\Microsoft\Office\12.0\A ccess\Security\Trusted
Locations\Location2]
AllowSubFolders (REG_DWORD) = 1
Path (REG_SZ) "C:\MyTrustedDatabaseFolderNo2"
 
Bob,

Forgive my ignorance, but the trusted location should be the folder where the DB is located correct?

If it is I tried that, and still get the message "The expression you entered has a funtion name that Microsoft Office Access can't find"
 
Bob,

Forgive my ignorance, but the trusted location should be the folder where the DB is located correct?
Yes, that is correct.
...and still get the message "The expression you entered has a funtion name that Microsoft Office Access can't find"
That almost sounds like a references error. Is there any chance you can upload the db, or email it to me if it is too big? You would need to run Compact and Repair first and then zip it with WinZip, or something similar and then it needs to be 393Kb or less to upload.
 
Thanks Bob,

I just send you an email with the attachment to your email on your website

Rookie2007
 
Thanks Bob,

I just send you an email with the attachment to your email on your website

Rookie2007

If you haven't already, don't send it there as I have a small email inbox and I don't think larger attachments will get through. I'll PM you the one to use.
 
Thanks Bob,

I just send you an email with the attachment to your email on your website

Rookie2007

By the way, it just came through and was only 125Kb in size, so you could have uploaded it here :D
 
Oh, and it would have helped to have the ACCDB file to take a look and see if there was anything that needed fixing so it would work. The ACCDE file just lets me see an error but I can't do anything about it.
 
Okay, since you sent a replica, I can't make an MDE file from a replica. But, I did find that you had ADO and DAO mixed and weren't explicit with the DAO. You should set a reference to Microsoft ActiveX DataObjects 6.0 and then change your FillOptions to this:
Code:
Private Sub FillOptions()
' Fill in the options for this switchboard page.

    ' The number of buttons on the form.
    Const conNumButtons = 8
    
    
    Dim rs As ADODB.Recordset
    Dim stSql As String
    Dim intOption As Integer
    
    Set rs = New ADODB.Recordset
    ' Set the focus to the first button on the form,
    ' and then hide all of the buttons on the form
    ' but the first.  You can't hide the field with the focus.
    Me![Option1].SetFocus
    For intOption = 2 To conNumButtons
        Me("Option" & intOption).Visible = False
        Me("OptionLabel" & intOption).Visible = False
    Next intOption
    
    ' Open the table of Switchboard Items, and find
    ' the first item for this Switchboard Page.
    
    stSql = "SELECT * FROM [Switchboard Items]"
    stSql = stSql & " WHERE [ItemNumber] > 0 AND [SwitchboardID]=" & Me![SwitchboardID]
    stSql = stSql & " ORDER BY [ItemNumber];"
    
    rs.Open stSql, CurrentProject.Connection, 1   ' 1 = adOpenKeyset
    
    ' If there are no options for this Switchboard Page,
    ' display a message.  Otherwise, fill the page with the items.
    If (rs.EOF) Then
        Me![OptionLabel1].Caption = "There are no items for this switchboard page"
    Else
        While (Not (rs.EOF))
            Me("Option" & rs![ItemNumber]).Visible = True
            Me("OptionLabel" & rs![ItemNumber]).Visible = True
            Me("OptionLabel" & rs![ItemNumber]).Caption = rs![ItemText]
            rs.MoveNext
        Wend
    End If

    ' Close the recordset and the database.
    rs.Close
    Set rs = Nothing
    

End Sub

You don't need the connection object as you can just reference CurrentProject.Connection within the code to open the recordset object.

Also, in your form's open code you need to explicitly define the DAO objects:
Code:
Private Sub Form_Open(Cancel As Integer)
' Minimize the database window and initialize the form.

    Dim dbs As DAO.Database
    Dim rst As DAO.Recordset

If I were you I would fix any, and all, code that refers to DAO and/or ADO in your db and see if that fixes things.
 
I am still having some problems, please refer to the attached DB.

I have a switchoard that loads up as the DB is open. I was able to get the switchboard window to maximized, but I cannot get the other forms' windows to maximize. I am fine when I start from the switchboard, but when I need to close or back up to a previous form, the form window get resized.

Also I created the DB in Access02, when I try to save it to 2007, i get the following message "You attempted to open a database that is already opened exclusively by user 'Admin' on machine 'mymachine'. Try again when the database is available." .

I am the only one on the db and and I cannot save the DB to 07 format unless is open? Any suggestions?
 

Attachments

Users who are viewing this thread

Back
Top Bottom