呵呵,我不懂代码,谁来看看:
Function 权限(类型 As String) As Boolean
Dim Rs As New ADODB.Recordset
Dim Sql As String
Dim StrPath As String
StrPath = CurrentProject.Path & "\data.dll"
Rs.ActiveConnection = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + Trim(StrPath) + ";"
Sql = "SELECT DISTINCT MSysAccounts_1.Name FROM (MSysAccounts INNER JOIN MSysGroups ON MSysAccounts.SID = MSysGroups.GroupSID) INNER JOIN MSysAccounts AS MSysAccounts_1 ON MSysGroups.UserSID = MSysAccounts_1.SID WHERE (((MSysAccounts_1.Name)=CurrentUser()) AND ((MSysAccounts.Name)='" & 类型 & "'));"
Set Rs = Rs.ActiveConnection.Execute(Sql)
If Rs.EOF Then
权限 = False
Else
权限 = True
End If
Set Rs = Nothing
End Function