Photo Gallery Member List Search Calendars FAQ Ticket List Log Out


Error reading LDAP and creating files with LOOP

 
Logged in as: Guest
arrSession:exec spGetSession 2,2,64940
 Active Users: There are 0 members and 0 guests.
 Users viewing this topic: none
 

 

 
  
  Printable Version
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!
Page: [1]
Login
Message << Older Topic   Newer Topic >>
 Error reading LDAP and creating files with LOOP - 10/9/2008 6:56:12 AM   
  itrent

 

Posts: 2
Score: 0
Joined: 10/9/2008
Status: offline
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.

Thanks.


      
 
 
Post #: 1
 
 RE: Error reading LDAP and creating files with LOOP - 10/9/2008 7:45:46 AM   
  itrent

 

Posts: 2
Score: 0
Joined: 10/9/2008
Status: offline
This issue is corrected. The strFile variable needed to be declared outside of the loop with a Dim statement. Thanks.

(in reply to itrent)
 
 
Post #: 2
 
 
 
  

If you found our site useful please link to us <a href="http://www.visualbasicscript.com">VisualBasicScript.com</a>.
All Forums >> [Scripting] >> WSH & Client Side VBScript >> Error reading LDAP and creating files with LOOP Page: [1]
Jump to:





New Messages No New Messages
Hot Topic w/ New Messages Hot Topic w/o New Messages
Locked w/ New Messages Locked w/o New Messages
 Post New Thread
 Reply to Message
 Post New Poll
 Submit Vote
 Delete My Own Post
 Delete My Own Thread
 Rate Posts