Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Lookup global Win NT groups through Access 97?

Status
Not open for further replies.

drlandau

IS-IT--Management
Jul 20, 2000
36
0
0
DK
Hi all,

Is there somehow it is possible to create a combobox (drop down box) in a form in Access 97 that will lookup global groups from a specified Windows NT domain or local groups from a specified Windows NT Server?

Is is at all possible to enumerate this kind of information from a VBA script...?

ANY help is HIGHLY appreciated!

All the best,
Nicolaj
 
Assuming the database is on the NT Server this bit of code should do the trick. Should the db not be on the server let me know-it'll be a lot trickier, but should still be doable. You'll need to change the references in this code to Combo0 to what ever your combo box is named. Good Luck!!!


Private Sub Combo0_Enter()

Dim strFile As String
Dim strOutput As String
Dim strRowSource As String

strOutput = Environ("temp") & "\localgroup.txt"

Shell Environ("ComSpec") & " /c " & "net localgroup > " & strOutput, vbHide

Open strOutput For Input As FreeFile

While EOF(FreeFile - 1) = False
Line Input #FreeFile - 1, strFile
If strFile Like "[*]*" Then
While InStr(strFile, &quot;*&quot;) <> 0
Mid(strFile, InStr(strFile, &quot;*&quot;), 1) = &quot;;&quot;
Wend
strRowSource = strRowSource & strFile
End If
Wend

Close FreeFile - 1

Kill strOutput

Let Me.Combo0.RowSourceType = &quot;Value List&quot;
Let Me.Combo0.RowSource = Right(strRowSource, Len(strRowSource) - 1)

End Sub
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top