All Forums >> [Scripting] >> WSH & Client Side VBScript >> Error reading LDAP and creating files with LOOP Do you like VisualBasicScript.com? Link to us and help spread the word about our forum. Thanks!
I am running a vbscript locally on my machine that is supposed to loop through an array of LDAP directories and created different files locally based on the read. I am repeatedly getting a 1041 error on the third read. It doesn't matter if all the LDAP references are the same and all of them do work; it still errors on the third attempt. The error occurs until I comment the section that opens the file for writing. When Set objTextFile = objFSO.OpenTextFile(strFile,ForAppending,True)
objTextFile.WriteLine (Acnt & vbTab & " A ") objTextFile.WriteLine (Bcnt & vbTab & " B ")
objTextFile.close
is commented out, there is no error. The only problem is that this code works fine when the read is not coming from an LDAP. So having the LDAP read and writing to a file locally is what seems to cause the issue.
Any assistance would be greatly appreciated.
PS. I have tried searching the forum and online but have not seen anything specific to this particular problem.