???? ID: 209871 - ????? ???????: 17 ??????? 2011 - ??????: 4.0

ACC2000: ??? ??????? ????? ???? ???????? ??????? ?? ???????

?????? ??????This article applies to a different operating system than the one you are using. Article content that may not be relevant to you is disabled.
?????: ?????? ???????? ??????, ?????????????? ?? multiuser ???? ???

?? ???? Microsoft Access ??????? (.mdb) ?? ??? ???? ???? ???? ???

?? ????? ??

??? ?? ??????? ???? | ??? ?? ??????? ????

??????

Microsoft Access ??? ???? ??????? ?? ??????? ?????? ???? ?? ??? ?? ?????????? ??????? ???????? ??:
  • ????/?????????? ???? ?? ?????????
  • ??????? ???????
?? ???? ???? ?????? ?? ?? ?? ?? ??? ?? ???? ??? ???????? ??????? ?? ??? ?? ?? ??????? ?? ??? ???-??? ??????? ???? ??????? ????

???? ???????

Microsoft ???????????? ?????? ???? ???????? ?? ??? ??? ???? ??, ???? ??? ??? ?? ?????? ?? ?????????? ??? ??? ?????? ???? ?? ????.. ?????? ???????? ?????? ?? ???? ????? ???????? ?? ??? ???????? ????? ??? ?? ???? ?? ????? ???? ???.. ?? ??? ????? ?? ?? ?? ????? ?? ?? ??? ???????????? ???? ?? ?? ??????? ?? ?????? ??? ????? ????? ???????????? ?? ????? ?? ???? ???? ?? ??? ???? ?? ??? ??.. Microsoft ?????? ???????? ?? ????? ????????? ?? ???????????? ?? ?????? ??? ?????? ?? ???? ???, ??, ?? ?? ???????? ?? ???? ??????? ?????????? ?? ?????? ???? ?? ??? ???????? ??????????????? ?? ?????? ?? ???????????? ????? ?? ??? ??????? ???? ??????..
???????: ??? ?? ?? ?????? ??? ??? ????? ?? ???? ????, ?? ????? ??????? Northwind.mdb ??????? ????? ?? ????? Northwind.mdb ???? ?? ??????? ?? ?? ????????? ?? ????? ????? ?? ???? ???? ?? ??? ?? ?????

???:: ?? ??? ??? ????? ??? Microsoft ???? ?????? ???????? ?? ????? ???? ??? ?? ??? ??? ?? ????? ?? ???, ?? ??? Microsoft DAO 3.6 ???????? ????????? ?????? ???? ?????? ??? ???? ?? ???, ????? ??????????????? ????????????? Visual Basic ?????? ???, ?? ????????? ???? ?? ??Microsoft DAO 3.6 ???????? ???????????? ????? ????? ???

???? ??????? ?? ???????? ???? ?? ??? ??????? ??? ?? ????? ?? ??? ??

??? ?? ????? ??, ?????? ?? ?? ???? ??? ????? ??????? ?? ??? ?? ??? ?????????? ??????? ?? ??????? ?? ???? ????? ??? ??? ?? ??? ??????? ???? ???? ??? ??, ??????? ?? ??????? ?? ?????

????? ?????? ???? ?????? ?? ?? ?? ??????? ?? ???? ??? ???? ??????? Northwind.mdb ????? ??????? ??? ???????? ????:
  1. ????? ??????? ?? ?? ?? Northwind.mdb ????? ??????? ??????
  2. Microsoft Visual Basic ?????? ?? ??????? ???? ?? ??? ALT + F11 ??????
  3. ????? ???????????? ???????? ??,???????.
  4. ??????? ????? ??? ????? ????????? ?? ?????:
    Public MyPassword
    Public Function KeyCode(Password As String) As Long
       ' This function will produce a unique key for the
       ' string that is passed in as the Password.
       Dim I As Integer
       Dim Hold As Long
    
       For I = 1 To Len(Password)
          Select Case (Asc(Left(Password, 1)) * I) Mod 4
          Case Is = 0
             Hold = Hold + (Asc(Mid(Password, I, 1)) * I)
          Case Is = 1
             Hold = Hold - (Asc(Mid(Password, I, 1)) * I)
          Case Is = 2
             Hold = Hold + (Asc(Mid(Password, I, 1)) * _
                (I - Asc(Mid(Password, I, 1))))
          Case Is = 3
             Hold = Hold - (Asc(Mid(Password, I, 1)) * _
                (I + Len(Password)))
       End Select
       Next I
       KeyCode = Hold
    End Function
    					
  5. ????? ??? ???? ?? ??? ALT + F11 ??????
  6. ??????? ????? ??? ?? ???????????????????? ????,?????????? ????-????? ????, ?? ???? ??????.
  7. ???????? ??????????? ????? ???, ???-????? ?????????? ?????.
  8. ???? ?? ???? ??????????? ?????:
       Table: tblPassword
       ---------------------------
       Field Name: ObjectName
          Data Type: Text
          Field Size: 50
       Field Name: KeyCode
          Data Type: Text
          Field Size: 25
          Input Mask: Password
    
       Table Properties: tblPassword
       -----------------------------
          PrimaryKey: ObjectName
    					
  9. TblPassword ?????? ?????, ?? ???? ??? ????? ???? ???? ????:
         ObjectName: Orders
           KeyCode: 2818
    					
  10. ?????? ????? ??? ?? ??? ??????? ?????, ?? ??????? ?? frmPassword ?? ??? ??? ???????
  11. ??? ??? ????? frmPassword Text0 ?? ?? ??? ???? ???? ??, ?? CheckPassword ???? ???? ??? ??? ???????
  12. ??? ????????? ???????? "???????" ???? ?? ??? Text0 ?? (??? ?????? ?????)?
  13. CheckPassword ??? ?? OnClick ????? ??? ????? ??? ??????, ?? ?? ??????? ??????:
    If IsNull(Forms!frmPassword!Text0.Value) Then
                     MsgBox "You cannot enter a blank Password. Try again."
                     Me!Text0.SetFocus
                Else
                     MyPassword = Me!Text0.Value
                     DoCmd.Close acForm, "frmPassword"
                End If 
    					
  14. ???? ??????? ?? ??????? ????? ??? ??????
  15. ??? ??? ????? ?? ????? ???? ???? ??, ?? ????? ???????????? ????????????? ??..
  16. ?? ??? ??????? ??? ????? ????? ????????? ???? ????OnOpen??????? ???:
    Private Sub Form_Open(Cancel as Integer)
       Dim Hold As Variant
       Dim tmpKey As Long
       Dim I As Integer
       Dim rs As DAO.Recordset
       Dim db As DAO.Database
    
       On Error GoTo Error_Handler
       ' Prompt the user for the Password.
       DoCmd.OpenForm "frmPassword", acNormal, , , , acDialog
                Hold = MyPassword
    ' Open the table that contains the password.
       Set db = CurrentDb
       Set rs = db.OpenRecordset("tblPassword", dbOpenTable)
       rs.Index = "PrimaryKey"
       rs.Seek "=", Me.Name
       If rs.NoMatch Then
          MsgBox "Sorry cannot find password information. Try Again"
          Cancel = -1
       Else
          ' Test to see if the key generated matches the key in
          ' the table; if there is not a match, stop the form
          ' from opening.
          If Not (rs![keycode] = KeyCode(Cstr(Hold))) Then
             MsgBox "Sorry you entered the wrong password." & _
                "Try again.", vbOKOnly, "Incorrect Password"
             Cancel = -1
          End If
       End If
       rs.Close
       db.Close
       Exit Sub
    
    Error_Handler:
       MsgBox Err.Description, vbOKOnly, "Error #" & Err.Number
       Exit Sub
    End Sub
    					
  17. ??? ????, ?? ???? ??? ???? ??????? ???????
  18. ???? ??????? ?????, ?? ??? ???? ????????????? ???? ??? ??? ??????? ?? ????

    ????? ??? ?? ???? ??????? ????? ??? KeyCode ?? ?????? ??????? ?? ?? ?????????tblPassword ?????? ??? KeyCode ?? ??? ???? ??, ?? ??????? ??? ???? ??????? ?? ?????? ?? ?????? ???
  19. ??? ???? ?? ???? ??????? ?? ??? ?? ????? ?? ??? ???? ????????????? ???? ??? ??? ??????? ?? ????

    ????? ??? ?? ???? ?? ????? ??????? ???? ??:
    ????? ??? ??????? ???? ???? ???? ???: ?????? ?????
    ????????? ?? ??????? ???-?????? ?? ??????? ???? ??????? ????? ?????
  20. ????????? ???? ?? ???? ??????? KeyCode ?? ?? ????? ???????? ?? ???, ??????? ????? ??? ????? ???? ????, ?? ???? ??? ENTER ?????:
    ?KeyCode("TestString")
    						
    ?????? ?????? 5864 ???? ???
  21. ??????? ????? ??? tblPassword ?????? ?? ?????? ?? ??? tblPassword ?????? ?? ????-????? ????, ?? ???? ??? ????? ???????. ??? ????? ??? ????? ?? ??? ???? ?? ??????? ??????????? ?? ????? ?? ??? ????? ????, ?? ???? ???OK.

???? ???? ???? ??:
  • Microsoft Access 2000 Standard Edition
??????: 
kbhowto kbmt KB209871 KbMthi
???? ?????? ???????????? ?????? ????????
??????????: ?? ???? ?? ???? ??????? ?? ????? ?? Microsoft ????-?????? ?????????? ?????? ?????? ???? ??? ??. Microsoft ???? ??? ????-???????? ?? ????-???????? ????? ?????? ?? ???? ???????? ???? ?? ???? ????? ????? ??? ?? ??? ?????? ?? ???? ???? ???? ??? ????? ??. ???????, ????-???????? ???? ????? ???? ???? ???? ???. ?????, ????????, ?????-???? ?? ??????? ?? ???????? ?? ???? ???, ???? ?? ??? ?????? ???? ???? ??? ????? ??? ?? ???? ??. Microsoft ??????? ??? ???? ?? ?????? ?? ??????????, ????????? ?? ??? ?????? ?? ???? ????? ?? ???? ???????? ?? ??? ???? ????? ?? ??? ????????? ???? ??. Microsoft ????-?????? ?????????? ?? ????? ?????? ?? ?? ??? ??.
?????????? ?? ??????? ????????? ??????? ??:209871  (http://support.microsoft.com/kb/209871/en-us/ )