LDAP Querys on Integer8 type fields
Hi All...
I'm trying to do the following LDAP query on computers in AD... I am having
issues reading fields of the Integer8 type...
Does anyone know how to process these fields in Access VB?
a vb Newbie..
thanks in advance
charlie
Public Function funTestADquery()
Dim Con As New Connection
Dim Cmd As New Command
Dim Rs As Recordset
'This section grabs the machine names from active directory
'--- Set the provider to Active Directory Search Object
Con.Provider = "AdsDSOObject"
'--- Open the connection
Con.Open "LDAP:"
'--- Set the active connection
Set Cmd.ActiveConnection = Con
Cmd.Properties("Page Size") = 10000
'--- Set the SQL query to execute
Cmd.CommandText = "SELECT AdsPath, cn, sAMAccountName, instanceType,
lastLogon " + _
"FROM 'LDAP://corp.mycompany.com' " + _
"WHERE objectCategory='computer'"
'--- Run the query
Set Rs = Cmd.Execute
'--- While not past the last row in the recordset...
Do While Not Rs.EOF
Debug.Print Rs.Fields(1)
Debug.Print Rs.Fields("cn")
' ****When I look at most fields no Problem
Debug.Print Rs.Fields("AdsPath")
Debug.Print Rs.Fields("sAMAccountName")
Debug.Print Rs.Fields("instanceType")
' ***** But when I try to look at an integer8 field if has an error Type
Mismatch...
Debug.Print Rs.Fields(" lastLogon")
Rs.MoveNext
Loop
Rs.Close
Con.Close
End Function