This is the code that works in the command prompt (It looks exactly like this). I'm trying to do the same thing in VBA:
The problem is that the file doesn't download, like it does above. In the command above the file exports to the correct location and the only thing printed to the command window is a new line. In the code below, all the records that should be in the file are printed to the window... it seems as though everything after "lastaccesstime" is being ignored, which means no export for me.
I don't know what the problem is... I put it in a string and viewed it with a msgbox and everything seemed the same... I'm open to suggestions. If any of you say "you should do this in ADO" by all means... show me how
Thank you,
Modest
Code:
C:\Program Files\tools> ldapsearch -D "cn=Directory Manager" -w testpass -h directorydev.domain.com -b aid=it0030,ou=Applications,o=domain.com,c=us userreferencedn=*xternal* dn lastaccesstime > "C:\Documents and Settings\UserLogin\Desktop\lastaccess.it0030.txt"
The problem is that the file doesn't download, like it does above. In the command above the file exports to the correct location and the only thing printed to the command window is a new line. In the code below, all the records that should be in the file are printed to the window... it seems as though everything after "lastaccesstime" is being ignored, which means no export for me.
Code:
Shell "C:\Program Files\tools\ldapsearch.exe " & _
"-D " & Chr$(34) & "cn=Directory Manager" & Chr$(34) & " " & _
"-w testpass " & _
"-h directorydev.domain.com " & _
"-b aid=it0030,ou=Applications,o=domain.com,c=us " & _
"userreferencedn=*xternal* dn lastaccesstime" & _
" > " & Chr$(34) & "C:\Documents and Settings\UserLogin\Desktop\lastaccess.it0030" & Chr$(34), _
vbNormalFocus
I don't know what the problem is... I put it in a string and viewed it with a msgbox and everything seemed the same... I'm open to suggestions. If any of you say "you should do this in ADO" by all means... show me how

Thank you,
Modest
Last edited: