Jump to content

interogate database with special characters


netcracker

Recommended Posts

I need to do a search on a db but the string contains characters like &.Say, i search for "M&M" ... the result will be an error because of that character.How do I get the values with &, and how do I do the searh ?in my case i get the value by querystring, so i think i need to convert that character to something else... but what and how !?Anyone stumbled upon that before ?!THX

Link to comment
Share on other sites

it's a MS Acces DB... so far.It may eventualy go on a SQL server but it is not certain yet.So far, on my IIS it returns an error.it is expected though... i mean look at the link:

whole path/file.asp?word=M&M
the server is confused... :)
Link to comment
Share on other sites

okay, I see the problem. The problem is the browser is having trouble with the Querystring. '&' is a delimiter in querystrings (?var1=value1&var2=value2) so you cannot use it in this way. What you could do before you send the querystring is replace '&' with another character or group of characters (eg M:and:M)Then when it gets to the next page change it back by replacing :and: with & just before you do the DB query.

Link to comment
Share on other sites

THX everyone !I managed to solved it by server.URLencode(rs.fields.item("blabla"))and then everything went well.thanks a lot

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...