home *** CD-ROM | disk | FTP | other *** search
/ io Programmo 27 / IOPROG_27.ISO / SOFT / ADSDK.ZIP / Samples / Interopt / Netware / NWCOMPAT.bas next >
Encoding:
BASIC Source File  |  1999-03-10  |  1000 b   |  48 lines

  1. Attribute VB_Name = "NWCOMPAT"
  2. Sub Main()
  3. Dim dso
  4. Dim obj
  5. Dim usrName
  6. Dim password
  7. Dim serverName
  8.  
  9. serverName = "ntmarst2"
  10.  
  11.  
  12. '-- Connecting
  13. '-- Assuming you have logged on to the Netware Server
  14. adsPathName = "NWCOMPAT://" & serverName
  15. Set cont = GetObject(adsPathName)
  16.  
  17. '--- Enumeration
  18. For Each obj In cont
  19.   Debug.Print obj.Name & " (" & obj.Class & ")"
  20. Next
  21.  
  22. '--- Object Creation
  23. adsPath = "NWCOMPAT://" & serverName
  24. Set cont = GetObject(adsPath)
  25. Set usr = cont.Create("user", "alicew")
  26. usr.SetInfo
  27.  
  28. '--- Attribute Retrieval and Modification
  29. objPath = "alicew,user"
  30. adsPath = "NWCOMPAT://" & serverName & "/" & objPath
  31. Set usr = GetObject(adsPath)
  32. usr.FullName = "Alice I. Wonderland"
  33. usr.SetInfo
  34.  
  35. Debug.Print usr.FullName
  36.  
  37.  
  38.  
  39. '--- Filtering
  40. adsPath = "NWCOMPAT://" & serverName
  41. Set con = GetObject(adsPath)
  42. con.Filter = Array("user", "group") 'Show user and group
  43.  
  44. For Each acct In con
  45.    Debug.Print acct.Name & " (" & acct.Class & ")"
  46. Next
  47. End Sub
  48.