Requirements
Installing
Gateway and Client Services for Netware
For Windows NT® 4.0
- Select Start | Setting |
Control Panel
- Choose Network Applet, and double-click it to
open up the Network Dialog.
- Select Gateway (and Client) Services for
Netware.
For Windows® 2000
- Select Start | Setting |
Network and Dial-up
Connection.
- Select Local Network.
Local Network will
appear.
- Select Client for Microsoft Network.
- Select Client icon, click Add.
- Select Gateway (and Client) Services for Netware.
- Installation should be in progress.
Connecting to an NDS Server
Dim dso
Dim obj
Dim usrName
Dim password
Dim serverName
serverName = "ntmarst2"
userName = "supervisor.ntmarst2"
password = "secretpwd"
'----Connecting----
Set dso = GetObject("NDS:")
Set cont = dso.OpenDSObject("NDS://" & serverName, userName, password, 0)
'----Enumeration----
For Each obj In cont
Debug.Print obj.Name & " (" & obj.Class & ")"
Next
Attribute Retrieval and
Modification
Path = "O=NTMARST2/CN=benny"
ADsPath = "NDS://" & serverName & "/" & Path
Set usr = dso.OpenDSObject(ADsPath, userName, password, 0)
Debug.Print usr.Get("Surname")
usr.Put "SurName", "Johnson"
usr.SetInfo
Object Creation
Path = "O=NTMARST2"
ADsPath = "NDS://" & serverName & "/" & Path
Set cont = dso.OpenDSObject(ADsPath, userName, password, 0)
Set usr = cont.Create("user", "alicew")
usr.Put "cn", "Alice"
usr.Put "Surname", "Wonderland"
usr.SetInfo
Searching
'----Searching----
ADsPath = "NDS://" & serverName
Set con = CreateObject("ADODB.Connection")
con.Provider = "ADsDSOObject"
con.Properties("User ID") = userName
con.Properties("Password") = password
con.Open "ADSI"
Set com = CreateObject("ADODB.Command")
Set com.ActiveConnection = con
com.CommandText = "SELECT ADsPath, 'Object Class' FROM '" & ADsPath &
"' WHERE Surname='Wonderland'"
Set rs = com.Execute
While Not (rs.EOF)
Debug.Print rs.Fields("ADsPath")
rs.MoveNext
Wend
source code \interopt\nds
|