Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

QueryString Question

Status
Not open for further replies.

onetomany

Programmer
May 15, 2000
55
US
I am trying to pass an item in a querystring that will be used as a parameter in a SQL Server query. However the item may or may not contain a ampersand. If the item does contain an ampersand then it is not being passed correctly through the querystring and is cutting off at the word before the ampersand making the query results incorrect.

An example is a user chooses to view all job listings in the administrative & Support department. the querystring is only passing the administrative part and the query is not returning anything even if there are listings in the database. Is there any way that I can pass a string containing an ampersand into the querystring.

I do not have any control over the name of the departments. So I cannot remove the ampersands that way.

Thanks
 
i believe you can Server.urlencode(it) or something along those lines. it should turn the ampersand into something more friendly
 
Are the departments listed in a lookup type of table so that you could use ID values to identify the departments instead of having to compare names?
Crystal
crystalized_s@yahoo.com

--------------------------------------------------

Experience is one thing you can't get for nothing.

-Oscar Wilde

 
Yes,
the departments are listed in a lookup table however unfortunately I was not given input on the design of the table and cannot change the table design. The table does not contain any type of ID's only the name of the department.





 
Lucid is right. On the server side, use server.urlencode. On the client, use escape()

nick bulka

 
That did it (server.urlencode)


thanks lucid and nick


Seth
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top