The Student Room Group
Reply 1
Not sure if this is what your talking about but I'll try to help:
First open your database exclusivly (click on the drop down menu next to open)
then go to tools-->security-->set database password
simple as that.
Hope it helped anyway ^_^
Reply 2
Darklight, did you user any code in producing your database?

SQL or vb ?
Reply 3
Hey create a form, add 2 txt boxes:
txtusername
txtpassword
create 1 command button:
cmdlogin


Option Compare Database
Dim I As Integer
Dim x As Integer


Private Sub cmdlogin_Click()


For I = 0 To 3

If x = 0 Then
MsgBox ("Error to many incorrect guesses")
x = 3
End
End If


If (Me.txtusername.Value = "admin") And (Me.txtpassword.Value = "pass") Then
DoCmd.OpenForm "frmShow"
Me.Visible = False
Else
MsgBox ("Error incorrect password entered " & vbCrLf & x & " attempts remaining"), vbExclamation, "Error"
x = x - 1
Exit Sub
End If

Next

End Sub

Private Sub Form_Load()
x = 3
End Sub


The password is hardcoded, if you need to link to a table then thats easy enough.

frmshow = form you wish to show

and i've never used forms in access before, but set the password form as initial startup thingy hehe
Reply 4
I'm using the inbuilt VB editor in Access, cheers for the code welsh_will, I'll try it out.

thanks guys!

Latest

Trending

Trending