Photo Gallery Member List Search Calendars FAQ Ticket List Log Out


""" synatax problems (WRAPPING)

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

 

 
  
  Printable Version
All Forums >> [Scripting] >> WSH & Client Side VBScript >> """ synatax problems (WRAPPING)
  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 >>
 """ synatax problems (WRAPPING) - 12/12/2005 11:53:40 AM   
  amfony

 

Posts: 6
Score: 0
Joined: 9/11/2005
Status: offline
Hey gang,


objCommand.CommandText = _
    "
LDAP://dc=Domain;" & "(&(objectCategory=person) (objectClass=user)" & "(sAMAccountName=MyerKen"));" & "sAMAccountName, distinguishedName;subtree"

This section of my script will search through my AD from domain level, search sub Ou's, to see if there is another user object with the sAMAccount name "MyerKen". This is cool but i want to substitue "MyerKen" for input from my Excel. Which can be repesented as strLogonID. This is what i tried to do.

strlogonTXT = "(sAMAccountName=" & strLogonID & "));"
objCommand.CommandText = _
    "<
LDAP://dc=Domain>;" & "(&(objectCategory=person) (objectClass=user)" & """ & strlogonTXT & """ & "sAMAccountName, distinguishedName;subtree"

As is painfully obvious, i need to be able to whack in the strLogonTXT variable to the part of the Command text line with the quotations put in place, without the system 'mistaking' (obviously not its correct, im not) the quoations order kind of thing. How do we do this gentlemen?

In semmation, my problems revolves around wrapping variables in "", but where im dropping the variables has already quotation marks so quotation marks get sort of sucked into wrapping OTHER stuff. Hard to explain but im sure you guys know all about it! Thanks guys  
 
 
Post #: 1
 
 RE: """ synatax problems (WRAPPING) - 12/12/2005 7:04:57 PM   
  ginolard


Posts: 1021
Score: 21
Joined: 8/10/2005
Status: offline
Use CHR(34)

   "<LDAP://dc=Domain>;" & "(&(objectCategory=person) (objectClass=user)" &  chr(34) & strlogonTXT  & chr(34) &  "sAMAccountName, distinguishedName;subtree"

This should work just fine

(in reply to amfony)
 
 
Post #: 2
 
 RE: """ synatax problems (WRAPPING) - 12/12/2005 7:22:41 PM   
  ehvbs

 

Posts: 2063
Score: 50
Joined: 6/22/2005
From: Germany
Status: offline
Hi amfony,

you may try this:


      

(in reply to amfony)
 
 
Post #: 3
 
 RE: """ synatax problems (WRAPPING) - 12/13/2005 12:37:36 AM   
  Country73


Posts: 712
Score: 8
Joined: 8/25/2004
From: USA
Status: offline
Personally I use the chr(34)
Whichever way you decide to go, just remember that wscript.echo is your friend.
If you're not sure you have enough quotes, or too many, just echo that line out and see what your actually passing along.

(in reply to amfony)
 
 
Post #: 4
 
 
 
  

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 >> """ synatax problems (WRAPPING) 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