Access Database Security Question

前端 未结 5 1323
野趣味
野趣味 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:36

    Could you not just do something like this

    Dim rst as Recordset
    Dim sql as string
    
    sql = "SELECT * FROM Tbl_BIRT_Users WHERE ntlogin = '" & Environ("UserName") & "'"
    set rst = CurrentDb.OpenRecordset(sql)
    
        if (rst.bof and rst.eof) then
            /*not a valid user*/
            DoCmd.Quit
        else
           if not rst!Administrator then
             /*make read only*/
           end if
        end if
    
    rst.close
    

提交回复
热议问题