Using GT and LT in a string

K

Koegel,Markus

Hello,
I have to build a string in an asp file for an AD request:
strcmd = "<GC://dc=mycompany,dc=com>;(&(objectCategory=User)" &
"(samAccountName=" & strUserName & "));distinguishedName;subtree".

Then I am executing with
objCommand.CommandText = strcmd
Set rstRecordSet = objCommand.Execute

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

Can anybody help me?

Thanks,

Markus
 
A

Anthony Jones

Koegel said:
Hello,
I have to build a string in an asp file for an AD request:
strcmd = "<GC://dc=mycompany,dc=com>;(&(objectCategory=User)" &
"(samAccountName=" & strUserName & "));distinguishedName;subtree".

Then I am executing with
objCommand.CommandText = strcmd
Set rstRecordSet = objCommand.Execute

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

Can anybody help me?

When you used Response.Write did you also user Server.HTMLEncode to escape <

Response.Write Server.HTMLEncode(strcmd)
 
K

Koegel,Markus

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.CreateObject("ADODB.Connection")
cnnConnection.Provider="ADsDSOObject"
cnnConnection.Open "Active Directory Provider"

Set objCommand = Server.CreateObject("ADODB.Command")
objCommand.ActiveConnection = cnnConnection

objCommand.CommandText = szlcmd
Set objlRecordSet = objCommand.Execute

Thank you,

Markus
 
K

Koegel,Markus

OK,

got it:
I had to add:
cnnConnection.Properties("User ID") = "..."
cnnConnection.Properties("Password") = ".."
Then it worked.

Sorry to bother you,

Markus
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,774
Messages
2,569,600
Members
45,179
Latest member
pkhumanis73
Top