By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
448,930 Members | 1,699 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 448,930 IT Pros & Developers. It's quick & easy.

Using Novell (via LDAP?) to authenicate

P: n/a

I'm trying very (too) hard to log uses LDAP (via ADSI) to autheniticate
users in an A2k2 application. We have AD and I have that working
slick. We are in a tranistion from NDS to AD and I would like to get
the NDS side working during the transition. I know the concept of what

Microsoft's information is very sparse and incomplete if not wrong.

1) What would the provider be (and how do we know if I/others have it)
2) What's require in the commandtext (some say LDAP://.. other say
NDS://.. neither work)
3) I'm assuming the context in required with user name but in what
4) What is the ASDI flag?

Keep in mind this code only works on the AD side (txtService = "AD").

This code (with a blank txtService) gives me a "Table does not exist"
error. What table?

private sub testlogin
Dim con As New Connection, rs As New Recordset, txtService As String

Dim adVariant
Dim i, j 'Used for counter
Dim Com As New Command
Dim strDomain, strPassword, strAttributeList, txtCommandText As String

'On Error GoTo Err_ThisSub

' Open a Connection object.
con.Provider = "ADsDSOObject"
con.Properties("ADSI Flag") = 1
txtService = ""
If txtService = "AD" Then
strAttributeList =
"sAMAccountname,displayName,distinguishedname,memb erOf"
con.Properties("User ID") = "ad\" & Me.txtUserName
con.Properties("Password") = Me.txtPassword
con.Open "Active Directory Provider"
txtCommandText = "<LDAP://servername/OU=Metro District,OU=District
Division,DC=ad,DC=dot,DC=state,DC=mn,DC=us>;(sAMAc countname=" &
Me.txtUserName & ");" & strAttributeList & ";subtree"
strAttributeList =
"dn,cn,fullname,givenname,groupmembership,employee number,mail"
con.Properties("User ID") =
"cn=marc1tim,ou=User,ou=MET,ou=RSV,ou=MSP,o=DO T"
con.Properties("Password") = Me.txtPassword
con.Open "NDS Provider"
txtCommandText =
"<LDAP://,ou=User,ou=MET,ou=RSV,ou=MSP,o=DOT>;(c n=marc1tim);"
& strAttributeList & ";subtree"
End If

' Create a command object on this connection.
Set Com.ActiveConnection = con
Com.CommandText = txtCommandText

' Set search preferences.
Com.Properties("Page Size") = 1000
Com.Properties("Timeout") = 30 'seconds

' Execute the query.
Set rs = Com.Execute

' Navigate the record set.
Me.txtOutput = Null
While Not rs.EOF
For i = 0 To rs.Fields.Count - 1
If rs.Fields(i).Type = vbVariant And Not
(IsNull(rs.Fields(i).Value)) Then
For j = LBound(rs.Fields(i).Value) To
Me.txtOutput = Me.txtOutput & rs.Fields(i).Name & " : "
& CStr(rs.Fields(i).Value(j)) & vbCr & vbLf
Next j
Me.txtOutput = Me.txtOutput & rs.Fields(i).Name & " : " &
rs.Fields(i).Value & vbCr & vbLf
End If
Next i


Set rs = Nothing

Exit Sub

MsgBox Err.Number & ": " & Err.Description, , "Login Error"
Resume Exit_ThisSub
End Sub

Nov 13 '05 #1
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.