single quotation string

Results 1 to 3 of 3

Thread: single quotation string

  1. #1
    Join Date
    Dec 1969

    Default single quotation string

    Hi All,<BR>My ASP page will retrieve a string/field from DB (which may contain single quotation mark) and place it into a textbox. However, the textbox only shows the string upto the first single quotation mark appears. For example, if the string is "It&#039s a wonder life", it shows "It". How can I show the entire string into the text box?

  2. #2
    Sonali B. Guest

    Default RE: single quotation string

    Guy,<BR>This may help you<BR>use following code ----------<BR>1)Enclose your value in quotes<BR>e.g --- &#060;input type="txtName" value="&#060;%=rst1.Name%&#062;" &#062;<BR>2)or try using this<BR>&#060;input type="txtName" value=&#060;%=chr(34) & rst1.Name & chr(34)%&#062; &#062;<BR><BR>Good Luck !!!!!<BR>Sonali B.<BR>

  3. #3
    robob Guest

    Default try this

    sql uses single quotation signs as string delimiters. so sql "thinks" after it is where the string ends.<BR>solution: you need to replace any single quotation mark with two single quotation marks. so in the db it should read: it´´s instead of it´s.<BR>when putting stuff into the db that was input by a user into a textbox you need to use the replace function: <BR>strUserInput = replace(strUserInput,"´","´´") this replaces each single quotation mark the user puts in the textbox with a double single quotation mark.<BR><BR>questions -

Posting Permissions

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