Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Networking problem..err kinda.. 1

Status
Not open for further replies.

RezaNana

Programmer
Dec 18, 2002
80
MY
Is it possible if we put the same db in 5 user computers,and make the start up page lock the monitor untill the admin give the permission for the user to run the program.The admin will give permission on perhaps by passwords which the admin will enter from his/her (admin) computer only. i have already tried it ,but it seems to fail..can anybody help??
 
Is it possible if we put the same db in 5 user computers,"

As in a different copy in each of the five PC's or one copy that the five PC's link to?

"and make the start up page lock the monitor untill the admin give the permission for the user to run the program."

Lock the monitor? Do you want to stop permission to JUST the application, or stop them from using the PC altogether?

"The admin will give permission on perhaps by passwords which the admin will enter from his/her (admin) computer only. i have already tried it ,but it seems to fail..can anybody help??"

There are many opinions and ways to 'secure' an access database.

May I suggest you investigate these two:

1) MS Access built in security (through the security wizard) that allows customizable levels of access.

2) Simply password protect the application (through tools) and ahave the admin walk around each PC and type it in.

From what I can gather, you dont want to give your users the ability to open the application, rather have an admin open it for them. Is this an education facility your developing for (e.g. college?)

------------------------
Hit any User to continue
 
hi.
"2) Simply password protect the application (through tools) and ahave the admin walk around each PC and type it in."
that might be the ultimate solution,if i can't find a way for the admin to remotely unlock the users Pc from his/her own (admin's) Pc. But wlking....hmmm.
anyway thanks..

 
Ok, failing that, have a form that opens with a timer on it. The timer checks every 1 sec(?) a field within the table.

Asumming that all your users are using the same db, then the admin could have a form that he/she changes the value of this field.

So:

Open the DB.. first form to load will be the the main menu with all controls set to disabled except one command button, called 'Admin'. Clicking on this opens a password protected form. Once the correct password entered, the field is automatically updated..

- Field set to no.. users cant do anything (e.g. controls disabled)
- Field set to yes.. controls enabled..

Means that the admin can kinda 'unlock' the DB remotely. Would require a bit of design work, but the theory is there.

------------------------
Hit any User to continue
 
hi again..
if tried that method before..but i'm using the "on current" method like this:

Private sub bla..bla on current()
if me.Password.value="admin" then
close form
end if
err..kinda like that..(i forgot most of the codes,but it's the correct code)
maybe using timer will do..but can you guide me..please??
and please gimmi the codes for using on timer() method
 
No worries..

Create tblAdminFlag with one field [fldFlag]

Add the following code to your main form

Code:
Private Sub Form_Load()   

'Lock all controls
	    cmdSomeButton1.Enabled = False
	    cmdAnotherbutton.Enabled = False
	    cmdAdmin.Enabled = True
'Set the form timer
    Me.TimerInterval = 1000 '1 second

End Sub

Private Sub Form_Timer()

'Call function to check the flag
    Call fCheckFlag
    
'Reset the timer
    Me.TimerInterval = 1000 '1 sec
End Sub

Private Function fCheckFlag
'Variables
    Dim rs As DAO.Recordset
    Dim strSQLSELECT As String
    
'Set the select / update SQL statements
    strSQLSELECT = "SELECT fldFlag " & _
                   "FROM tblAdminFlag "

'open recordset
    Set rs = CurrentDb.OpenRecordset(strSQLSELECT)
    
'Check flag
    rs.MoveFirst
    Select Case rs!fldFlag
        Case 0
            'no action required
        Case 1
	    cmdSomeButton1.Enabled = True
	    cmdAnotherbutton.Enabled = True
            '.... etc
    End Select
End Function
Your admin form can basically have the following code:

Code:
Private Sub Form_Load()   

	Dim strPass as String
	Dim strSQL as String

	strPass = Inputbox("Please enter the admin password")
        strSQLUPDATE = "UPDATE tblAdminFlag" & _
                       "SET fldFlag = 0 "

	select case strPass
		Case = "MyPassword"
                 'correct password
		 Docmd.RunSQL strSQL
		Case Else
		 msgbox "Invalid Password"
		 Exit Sub
	End Select

End Sub

Untested code as written on the fly, but this will give good grounding...

------------------------
Hit any User to continue
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top