deploy different front ends

krberube

just beyond new
Local time
Today, 12:04
Joined
Jan 14, 2005
Messages
142
If my DB is a BE/FE, can i take a copy of the FE and remove items ( reports, queries.....) and use the copy on a users system. Then take another copy, remove different items and do the same??
I am only asking this since I only have 5 systems to manage and 2 i would like to have limited access on, I learn more about the MS access security. I have already screwed up 2 trys at security and would feel better about going this route short term.

Thanks
Kevin
 
Other than the obvious difficulties keeping track of who has what and updating them when a change is necessary, there shouldn't be a problem with what you describe.
 
That won't be too bad to manage. only those 2 systems should ge tmodified ones. I realize it doesn't get me much, but it gives the boss ( who knows nothing about access) a warm fuzzy feeling. So, when I figure the security thing out, we'll all be happy, :D

Maybe in the next release, MS can make security alittle easier to use :)
 
The other option is to have the users log in to the front end and use that to allow or hide cretin objects from them in you code.

This way you would only have the one FE to manage. Just a thought.
:)
 
It's funny this question should come up. I just went through this, and I went with this:
Made a utility database in a network folder.
Put back end and two versions of front end in subfolder.
Set registration form as startup form of utility db.
In OnOpen event of form, check to see if person is already registered in personnel table, and if their access level is sufficient, copy the Admin front end to their MyDocs folder...else copy the common user front end (identifies the user via fosUserName() function).
Create shortcut on their desktop that points to the front end copy in their MyDocs folder (using Windows Script Hosting).
The new front end will overwrite their copy of the front end in any case, and this is how I distribute updates. I just send out an email saying to run the utility database from the network.
After they run the utility db, a message box tells them it was successful and to run the db from their desktop shortcut in the future.
Does that make sense?
 
Out of curiosity,

following up with what Sarge is proposing, would it be possible to screen users for different FE,s by having Access check the username that has been logged into the network from a particular workstation?
 
Well, yes...that's exactly what I'm doing. I have a conditional copyfile, based on their user type in the back end (which I set).
 
Sergeant,

okay, I think I see. Your backend has their network workstation username in a table, and the conditional compares the network log-in username to what's stored in your BE.
 
Thats not a bad idea, i may go that way for the short term.
Thanks for the ideas.
 
In case it helps someone, here is my crude code...
Code:
Private Sub Form_Open(Cancel As Integer)
    'This is the registration form's OnOpen event
    'Everyone should have a user type (UType) '1', and admins also have a 2,3,4,5 or 6
    Select Case DCount("UType", "tblPPL", "UName = '" & fOSUserName() & "'")
        Case Is = 0
            'user not loaded yet...allow form to open and register...
            CopyDB (False) 'copy the standard user's front end
            MsgBox "The application has been set up on your computer." & vbCrLf & _
            "Use the 'FitDB' shortcut on your Desktop to access the program." & vbCrLf & _
                        "You still need to create a user profile..." & vbCrLf & _
                        "Complete the entries on the following form."
            Me.DataEntry = True
            Exit Sub
        Case Is = 1
            'one entry for this person, check to make sure the UType...
            If DLookup("Utype", "tblPPL", "UName = '" & fOSUserName() & "'") > 1 Then
                CopyDB (True) 'copy the admin front end
                MsgBox "The application has been set up on your computer." & vbCrLf & _
                "Use the 'FitDB' shortcut on your Desktop to access the program."
                Me.DataEntry = True
                Me.Rnk = DLookup("Rnk", "tblPPL", "UName = '" & fOSUserName() & "'")
                Me.LName = DLookup("LName", "tblPPL", "UName = '" & fOSUserName() & "'")
                Me.FName = DLookup("FName", "tblPPL", "UName = '" & fOSUserName() & "'")
                Me.FltID = DLookup("FltID", "tblPPL", "UName = '" & fOSUserName() & "'")
                'the default for user type is '1'
                DoCmd.RunCommand acCmdSaveRecord
                Application.Quit
            Else
                CopyDB (False)
                MsgBox "You have updated the application on your computer." & vbCrLf & _
                    "Continue to run the application from your desktop shortcut."
            End If
            
        Case Is > 1
            'person has higher access...
            CopyDB (True)
            MsgBox "You have updated the application on your computer." & vbCrLf & _
            "Continue to run the application from your desktop shortcut."
            Cancel = True
            Application.Quit
        Case Else
            MsgBox "An error has occurred...contact the database administrator"
    End Select
    Cancel = True
    Application.Quit
    
End Sub

Function fOSUserName() As String
    'Returns the network login name (function found on this forum)
    Dim lngLen As Long, lngX As Long
    Dim strUserName As String
    strUserName = String$(254, 0)
    lngLen = 255
    lngX = apiGetUserName(strUserName, lngLen)
    If lngX <> 0 Then
        fOSUserName = Left$(strUserName, lngLen - 1)
        ElsefOSUserName = ""
    End If
End Function


Public Sub CopyDB(Optional LoadAdmin As Boolean = False)
    Dim fso As New FileSystemObject
    Dim UProf As String
    Dim DBLoc As String
    Dim objShell
    Dim objShortcut
    'Check to see if they have the FitDB folder in "MyDocs"...
    UProf = Environ("userprofile")
    If Not fso.FolderExists(UProf & "\My Documents\FitDB") Then
        fso.CreateFolder UProf & "\My Documents\FitDB"
    End If
    If LoadAdmin Then
        'Select Admin DB...
        DBLoc = CurrentProject.Path & "\BackEnd\FitnessAdmin.mdb"
    Else
        DBLoc = CurrentProject.Path & "\BackEnd\Fitness.mdb"
    End If
    fso.CopyFile DBLoc, UProf & "\My Documents\FitDB\Fitness.mdb"
    fso.CopyFile CurrentProject.Path & _
        "\BackEnd\jogger.ico", "C:\WINDOWS\system32\jogger.ico"
    Set objShell = New WshShell
    Set objShortcut = objShell.CreateShortcut(UProf & "\Desktop\FitDB.lnk")
    objShortcut.TargetPath = UProf & "\My Documents\FitDB\Fitness.mdb"
    objShortcut.IconLocation = "%SystemRoot%\system32\jogger.ico"
    objShortcut.Save
    Set objShell = Nothing
    Set objShortcut = Nothing
    
    
End Sub
 
Thanks Sergeant, for posting that. I put in more searches, and found some great posts on this topic. GHudson had made a post about the use of

Environ("UserName")

for doing this also, and it looks to work very well.

This pricked my interest because of the instrument data project I've been working on, where I call on Access to do an automated import of instrument data that's sent out by an instrument in an unwieldy text file. I actually have this application running on 3 workstations. Two are on their own spectrometers, running the same software. This grabbing of the User Name will help me in having the application do the right thing, no matter which workstation and spectrometer, without having to have 3 different versions of the FE.

Thanks to all, as this site has helped my understanding greatly.
 

Users who are viewing this thread

Back
Top Bottom