2012-10-01 58 views
0

是否有可能在MS Access 2010 db應用程序中執行SSO。如果是的話我將如何實現這一目標?SSO以ms訪問2010

到目前爲止,我在登錄表單上進行了ldap身份驗證,但是我想繞過此操作並自動轉到下一個屏幕。以下是我迄今爲止

Function CheckUser(username As String, passwd As String, Level As Integer) As Boolean 

    On Error GoTo LDAP_Error 

    Const ADS_SCOPE_SUBTREE = 2 

    Dim LDAPPath As String 
    LDAPPath = "LDAP://akutan.usa.domain.com/OU=Sites;DC=domain;DC=com" 

    Dim conn As ADODB.Connection 
    Dim cmd As ADODB.Command 
    Dim rs As ADODB.Recordset 

    Set conn = New ADODB.Connection 
    Set cmd = New ADODB.Command 
    conn.Provider = "ADsDSOObject" 
    conn.Properties("User ID") = "domain\" & username 
    conn.Properties("Password") = "" & passwd 
    conn.Properties("Encrypt Password") = True 
    'conn.Properties("ADSI Flag") = 3 
    conn.Open "Active Directory Provider" 

    Set cmd.ActiveConnection = conn 
    cmd.Properties("Page Size") = 1000 
    cmd.Properties("Searchscope") = ADS_SCOPE_SUBTREE 
    cmd.CommandText = "SELECT Name FROM '" & LDAPPath & "' WHERE " & "objectCategory='user'" 

    Set rs = cmd.Execute 
    rs.Close 
    conn.Close 

    CheckUser = True 
    [TempVars]![CurrentUser] = username 
    Call LogUser([TempVars]![CurrentUser], "Logon") 
    Exit Function 

LDAP_Error: 

    If Err.Number = -2147217911 Then 
     MsgBox "Incorrect PeopleSoftID or Password!", vbExclamation, "LDAP Authentication" 
    Else 
     MsgBox "Error : " & Err.Description & " " & Err.Number, vbExclamation, "LDAP Authentication" 
    End If 

    CheckUser = False 
    conn.Close  
End Function 
+1

http://www.accesssecurityblog.com/post/2011/02/05/Securing-Access-databases-using-Active-Directory.aspx也許這適用於... – rene

+0

這顯示安全許可,我也會嘗試實現但不完全是我在找什麼 – shorif2000

回答

0

我爲了讓所有我的表/存儲過程的單點登錄使用「Access數據項目」。