Using GT and LT in a string

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Koegel,Markus

    Using GT and LT in a string

    Hello,
    I have to build a string in an asp file for an AD request:
    strcmd = "<GC://dc=mycompany,dc =com>;(&(object Category=User)" &
    "(samAccountNam e=" & strUserName & "));distinguish edName;subtree" .

    Then I am executing with
    objCommand.Comm andText = strcmd
    Set rstRecordSet = objCommand.Exec ute

    But <GC://dc=mycompany,dc =com> vanishes from the string (checked in a output
    with response.write) .

    Can anybody help me?

    Thanks,

    Markus



  • Anthony Jones

    #2
    Re: Using GT and LT in a string


    "Koegel,Mar kus" <Markus.Koegel@ bc.boehringer-ingelheim.com> wrote in message
    news:e68lk3$4nh $1@news.dtag.de ...[color=blue]
    > Hello,
    > I have to build a string in an asp file for an AD request:
    > strcmd = "<GC://dc=mycompany,dc =com>;(&(object Category=User)" &
    > "(samAccountNam e=" & strUserName & "));distinguish edName;subtree" .
    >
    > Then I am executing with
    > objCommand.Comm andText = strcmd
    > Set rstRecordSet = objCommand.Exec ute
    >
    > But <GC://dc=mycompany,dc =com> vanishes from the string (checked in a[/color]
    output[color=blue]
    > with response.write) .
    >
    > Can anybody help me?
    >[/color]

    When you used Response.Write did you also user Server.HTMLEnco de to escape <[color=blue]
    >?[/color]

    Response.Write Server.HTMLEnco de(strcmd)


    [color=blue]
    > Thanks,
    >
    > Markus
    >
    >
    >[/color]


    Comment

    • Koegel,Markus

      #3
      Re: Using GT and LT in a string

      Hello,

      yeah, thanks that was it!

      But that means that the problem is somewhere else in my asp.
      I get the error 'Table does not exist' in the last line when I try to
      execute

      Set cnnConnection = Server.CreateOb ject("ADODB.Con nection")
      cnnConnection.P rovider="ADsDSO Object"
      cnnConnection.O pen "Active Directory Provider"

      Set objCommand = Server.CreateOb ject("ADODB.Com mand")
      objCommand.Acti veConnection = cnnConnection

      objCommand.Comm andText = szlcmd
      Set objlRecordSet = objCommand.Exec ute

      Thank you,

      Markus


      "Anthony Jones" <Ant@yadayadaya da.com> wrote in message
      news:OSVCv0siGH A.3572@TK2MSFTN GP04.phx.gbl...[color=blue]
      >
      > "Koegel,Mar kus" <Markus.Koegel@ bc.boehringer-ingelheim.com> wrote in
      > message
      > news:e68lk3$4nh $1@news.dtag.de ...[color=green]
      >> Hello,
      >> I have to build a string in an asp file for an AD request:
      >> strcmd = "<GC://dc=mycompany,dc =com>;(&(object Category=User)" &
      >> "(samAccountNam e=" & strUserName & "));distinguish edName;subtree" .
      >>
      >> Then I am executing with
      >> objCommand.Comm andText = strcmd
      >> Set rstRecordSet = objCommand.Exec ute
      >>
      >> But <GC://dc=mycompany,dc =com> vanishes from the string (checked in a[/color]
      > output[color=green]
      >> with response.write) .
      >>
      >> Can anybody help me?
      >>[/color]
      >
      > When you used Response.Write did you also user Server.HTMLEnco de to escape
      > <[color=green]
      >>?[/color]
      >
      > Response.Write Server.HTMLEnco de(strcmd)
      >
      >
      >[color=green]
      >> Thanks,
      >>
      >> Markus
      >>
      >>
      >>[/color]
      >
      >[/color]


      Comment

      • Koegel,Markus

        #4
        Re: Using GT and LT in a string

        OK,

        got it:
        I had to add:
        cnnConnection.P roperties("User ID") = "..."
        cnnConnection.P roperties("Pass word") = ".."
        Then it worked.

        Sorry to bother you,

        Markus


        "Koegel,Mar kus" <Markus.Koegel@ bc.boehringer-ingelheim.com> wrote in message
        news:e68sdh$99v $1@news.dtag.de ...[color=blue]
        > Hello,
        >
        > yeah, thanks that was it!
        >
        > But that means that the problem is somewhere else in my asp.
        > I get the error 'Table does not exist' in the last line when I try to
        > execute
        >
        > Set cnnConnection = Server.CreateOb ject("ADODB.Con nection")
        > cnnConnection.P rovider="ADsDSO Object"
        > cnnConnection.O pen "Active Directory Provider"
        >
        > Set objCommand = Server.CreateOb ject("ADODB.Com mand")
        > objCommand.Acti veConnection = cnnConnection
        >
        > objCommand.Comm andText = szlcmd
        > Set objlRecordSet = objCommand.Exec ute
        >
        > Thank you,
        >
        > Markus
        >
        >
        > "Anthony Jones" <Ant@yadayadaya da.com> wrote in message
        > news:OSVCv0siGH A.3572@TK2MSFTN GP04.phx.gbl...[color=green]
        >>
        >> "Koegel,Mar kus" <Markus.Koegel@ bc.boehringer-ingelheim.com> wrote in
        >> message
        >> news:e68lk3$4nh $1@news.dtag.de ...[color=darkred]
        >>> Hello,
        >>> I have to build a string in an asp file for an AD request:
        >>> strcmd = "<GC://dc=mycompany,dc =com>;(&(object Category=User)" &
        >>> "(samAccountNam e=" & strUserName & "));distinguish edName;subtree" .
        >>>
        >>> Then I am executing with
        >>> objCommand.Comm andText = strcmd
        >>> Set rstRecordSet = objCommand.Exec ute
        >>>
        >>> But <GC://dc=mycompany,dc =com> vanishes from the string (checked in a[/color]
        >> output[color=darkred]
        >>> with response.write) .
        >>>
        >>> Can anybody help me?
        >>>[/color]
        >>
        >> When you used Response.Write did you also user Server.HTMLEnco de to
        >> escape <[color=darkred]
        >>>?[/color]
        >>
        >> Response.Write Server.HTMLEnco de(strcmd)
        >>
        >>
        >>[color=darkred]
        >>> Thanks,
        >>>
        >>> Markus
        >>>
        >>>
        >>>[/color]
        >>
        >>[/color]
        >
        >[/color]


        Comment

        Working...