Access Database Security Question

前端 未结 5 1368
野趣味
野趣味 2021-01-26 15:01

I have a database in Access 2003 that I only want certain people to be able to access. In my database I have a table which lists the people that should be able to access the da

5条回答
  •  刺人心
    刺人心 (楼主)
    2021-01-26 15:45

    Try something like the below:

    Function RealName()
    payroll = Environ("Username")
    
    firstname = DLookup("[first name]", "[Payroll Numbers]", "[persno] = " & payroll)
    lastname = DLookup("[Last name]", "[Payroll Numbers]", "[persno] = " & payroll)
    
    If IsNull(firstname) = True Then
    RealName = payroll
    Else
    RealName = firstname & " " & lastname
    End If
    
    End Function
    

    You can then enter code in the form_load event to make sure it's a verified user.

提交回复
热议问题