Hello. I am looking for some help with an issue that I have not seen before when using an array to export the description field for user accounts. I can attached the entire script if needed although the arr used is below. On some users they have a long description for one reason or another and when writing out to a log file it breaks to a new line at some point in writing the description. I am writing 5-6 different attributes and description is last if that matters. Any help is appreciated.
The description attribute is multi-valued, but
' there is never more than one item in the array.
arrDesc = adoRecordset.Fields("description").Value
If IsNull(arrDesc) Then
strDescription = ""
Else
For Each strItem In arrDesc
strDescription = strItem
Next
End If
Description field line breaks when exporting in vbscript
Forum rules
Do not post any licensing information in this forum.
Any code longer than three lines should be added as code using the 'Select Code' dropdown menu or attached as a file.
Do not post any licensing information in this forum.
Any code longer than three lines should be added as code using the 'Select Code' dropdown menu or attached as a file.
Re: Description field line breaks when exporting in vbscript
Sorry. The description arr I am using to get everything in the description field is:
' The description attribute is multi-valued, but
' there is never more than one item in the array.
arrDesc = adoRecordset.Fields("description").Value
If IsNull(arrDesc) Then
strDescription = ""
Else
For Each strItem In arrDesc
strDescription = strItem
Next
End If
' The description attribute is multi-valued, but
' there is never more than one item in the array.
arrDesc = adoRecordset.Fields("description").Value
If IsNull(arrDesc) Then
strDescription = ""
Else
For Each strItem In arrDesc
strDescription = strItem
Next
End If
Re: Description field line breaks when exporting in vbscript
But that only gets the last element of the array. Try catting them.new_user wrote:Sorry. The description arr I am using to get everything in the description field is:
' The description attribute is multi-valued, but
' there is never more than one item in the array.
arrDesc = adoRecordset.Fields("description").Value
If IsNull(arrDesc) Then
strDescription = ""
Else
For Each strItem In arrDesc
strDescription = strItem
Next
End If
Re: Description field line breaks when exporting in vbscript
Thank you for the reply not sure what you are referring to by catting them; how would that array to capture the description field contents change?
Re: Description field line breaks when exporting in vbscript
My code is attached to show how I am calling the array. and example of the output capture is also attached. This does work except if the data in the description field is very long. I am not clear regarding concatenating.
- Attachments
-
- Capture.JPG (65.18 KiB) Viewed 26200 times
-
- LockedOut_.txt
- (5.65 KiB) Downloaded 537 times
Re: Description field line breaks when exporting in vbscript
It is used all of the time in every area of language and computers.
http://www.thefreedictionary.com/catenate
We "cat" something. In Unix there is even a command called "cat". It comes from "catenate". It has nothing to do with cute little kitties.
http://www.thefreedictionary.com/catenate
We "cat" something. In Unix there is even a command called "cat". It comes from "catenate". It has nothing to do with cute little kitties.
Re: Description field line breaks when exporting in vbscript
To be clearer. You are assigning an array element to a string. It needs to be catenated and not assigned.
There is a command that does that.
Do you need an example?
There is a command that does that.
Do you need an example?