Special chars and SQL

Results 1 to 3 of 3

Thread: Special chars and SQL

  1. #1
    Jarrod Loerzel Guest

    Default Special chars and SQL

    Can anyone tell me:<BR>Is there a way to "escape" the ampersand (&) in SQL? I have data that occasionally has these chars in a primary key, and everytime I hit one of those my query string bombs...I&#039ve tried to use the single quote, and it works for the apostrophe(O&#039Leary), but not the ampersand.<BR>I&#039ve even tried the Replace() in asp with no luck.<BR>Anyone?<BR>Thanx

  2. #2
    Stephen Fisher Guest

    Default RE: Special chars and SQL

    Depending on where you are using it<BR>Server.HTMLEncode<BR>or <BR>Server.URLEncode<BR><BR>I will assume you want the Server.URLEncode(string to encode)

  3. #3
    Jarrod Loerzel Guest

    Default RE: Special chars and SQL

    No, but I really appreciate the attempt. I&#039m trying to throw a query together on the fly. The only field that is unique in the Fox Pro Database is the customers ID. This ID field contains, in some of the records, an ampersand(&). This bombs my SQL statement when I go to display the record. Is there any way to escape this char? Or am I just hosed?!?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts