473,387 Members | 3,750 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

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>;(&(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

Jun 8 '06 #1
3 1238

"Koegel,Markus" <Ma***********@bc.boehringer-ingelheim.com> wrote in message
news:e6**********@news.dtag.de...
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)
Thanks,

Markus

Jun 8 '06 #2
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
"Anthony Jones" <An*@yadayadayada.com> wrote in message
news:OS**************@TK2MSFTNGP04.phx.gbl...

"Koegel,Markus" <Ma***********@bc.boehringer-ingelheim.com> wrote in
message
news:e6**********@news.dtag.de...
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)
Thanks,

Markus


Jun 8 '06 #3
OK,

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

Sorry to bother you,

Markus
"Koegel,Markus" <Ma***********@bc.boehringer-ingelheim.com> wrote in message
news:e6**********@news.dtag.de...
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
"Anthony Jones" <An*@yadayadayada.com> wrote in message
news:OS**************@TK2MSFTNGP04.phx.gbl...

"Koegel,Markus" <Ma***********@bc.boehringer-ingelheim.com> wrote in
message
news:e6**********@news.dtag.de...
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)
Thanks,

Markus



Jun 8 '06 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: Enos Meroka | last post by:
Hallo, I am a student doing my project in the university.. I have been trying to compile the program using HP -UX aCC compiler, however I keep on getting the following errors. ...
0
by: canasdaq | last post by:
Can anyone please help me. I was looking at the article "http://www.eggheadcafe.com/articles/20030603.asp". I am new to .net and know nothing in c#. I want to write a menu in asp.net. Can anyone...
3
by: Random Person | last post by:
Does anyone know how to use VBA to relink tables between two MS Access databases? We have two databases, one with VBA code and the other with data tables. The tables are referenced by linked...
11
by: Grasshopper | last post by:
Hi, I am automating Access reports to PDF using PDF Writer 6.0. I've created a DTS package to run the reports and schedule a job to run this DTS package. If I PC Anywhere into the server on...
1
by: Daveyk0 | last post by:
Hello there, I have a front end database that I have recently made very many changes to to allow off-line use. I keep copies of the databases on my hard drive and link to them rather than the...
9
by: Guy | last post by:
I have extended the datetimepicker control to incorporate a ReadOnly property. I have used the new keyword to implement my own version of the value property, so that if readonly == true then it...
1
by: Prasad Karunakaran | last post by:
I am using the C# DirectoryEntry class to retrieve the Properties of an user object in the Active Directory. I need to get the First Name and Last Name as properties. I know it is not supported...
0
by: Michelle Keys | last post by:
I am trying to call a print function to print a string from a database using javascript. Which is RC_DATA of Varchar2(2500). This is a javascript is not being used. I have a thing that needs to...
3
by: JDeats | last post by:
I have some .NET 1.1 code that utilizes this technique for encrypting and decrypting a file. http://support.microsoft.com/kb/307010 In .NET 2.0 this approach is not fully supported (a .NET 2.0...
1
by: WeCi2i | last post by:
Okay, I have a problem that has been stumping me for weeks. I have tried many different solutions and this is pretty much my last resort. I have seen a lot of good answers give here so I figured I...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.