Superscript (TM) in SQL string using ASP?

Discussion in 'ASP General' started by MBS, Feb 6, 2004.

  1. MBS

    MBS Guest

    I am trying to pass a string from one page to another. The input
    string comes from a database and many times has the superscript TM
    trademark symbol. The querystring handles this properly because it
    appears correctly in the next pages URL. However, when I do a
    response.write of the querystring, the symbol has been changed to
    "ProductT" for example so I can't assign this to an SQL string. Of
    course, the database dosen't return this. How can I get around this?

    Thanks
    Bailey--
     
    MBS, Feb 6, 2004
    #1
    1. Advertising

  2. MBS

    Bob Barrows Guest

    MBS wrote:
    > I am trying to pass a string from one page to another. The input
    > string comes from a database and many times has the superscript TM
    > trademark symbol. The querystring handles this properly because it
    > appears correctly in the next pages URL. However, when I do a
    > response.write of the querystring, the symbol has been changed to
    > "ProductT" for example so I can't assign this to an SQL string. Of
    > course, the database dosen't return this. How can I get around this?
    >
    > Thanks
    > Bailey--


    Depending on where you are writing it to, you may need to use the HTMLEncode
    function to handle the non-standard characters.

    HTH,
    Bob Barrows

    --
    Microsoft MVP - ASP/ASP.NET
    Please reply to the newsgroup. This email account is my spam trap so I
    don't check it very often. If you must reply off-line, then remove the
    "NO SPAM"
     
    Bob Barrows, Feb 6, 2004
    #2
    1. Advertising

  3. MBS

    MBS Guest

    Can you elaborate further on how to implement this function in this
    context? The string (containing the superscript) will be used in an
    SQL "where" clause to re-query the database. I looked up the function
    but I guess I am not knowledgeable enough to understand how it relates
    to this. I also did a search on google to see how superscript and
    other non-standard characters are handled in sql strings using ado and
    surprisingly can't find anything.

    Thanks.
     
    MBS, Feb 8, 2004
    #3
  4. MBS

    Bob Barrows Guest

    MBS wrote:
    > Can you elaborate further on how to implement this function in this
    > context? The string (containing the superscript) will be used in an
    > SQL "where" clause to re-query the database. I looked up the function
    > but I guess I am not knowledgeable enough to understand how it relates
    > to this. I also did a search on google to see how superscript and
    > other non-standard characters are handled in sql strings using ado and
    > surprisingly can't find anything.
    >
    > Thanks.


    Without seeing your code, the only thing I can say is:

    response.write htmlencode(<whatever>))

    Bob Barrows

    --
    Microsoft MVP - ASP/ASP.NET
    Please reply to the newsgroup. This email account is my spam trap so I
    don't check it very often. If you must reply off-line, then remove the
    "NO SPAM"
     
    Bob Barrows, Feb 8, 2004
    #4
  5. MBS

    MBS Guest

    Okay, here is some of the relevant code.

    Here is the needed string with the "TM" getting past from the first
    page:
    Meniett™ Ménière's Disease Therapy Device

    LinkText = Replace(Request.QueryString("LinkText"), "'", "''")
    Set Recordset1 = Server.CreateObject("ADODB.Recordset")
    Recordset1.ActiveConnection = MM_Conn_Xom_STRING
    SQL ="SELECT distinct category, subcat FROM GroupInfo Where Category
    ='"&LinkText&"'" & "ORDER BY subcat"
    Recordset1.Source = SQL

    response.write server.htmlencode(SQL)
    '= MeniettT Ménière''s Disease Therapy Device
    'This is the same output as when not using the htmlencode! What am I
    missing?

    Recordset1.Source = SQL
     
    MBS, Feb 9, 2004
    #5
  6. MBS

    MBS Guest

    Another thing that I am noticing is that whenever the querystring
    contains the registered trademark symbol "®" that if I do a
    response.write of the string, the symbol appears correctly but is
    flaky when going against the access db. For example sometimes the
    recordset is empty when in fact, it is not. However, if I cut and
    paste this (below) and run it inside access, there are records! It is
    as though some special characters are getting dropped from the asp
    page to the database. What's up with this?

    Here is a sample:
    SELECT * from products where prodname=activent®
     
    MBS, Feb 10, 2004
    #6
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. dalei
    Replies:
    5
    Views:
    9,995
    Neredbojias
    Aug 28, 2005
  2. jodleren
    Replies:
    12
    Views:
    1,635
    GTalbot
    Jan 4, 2008
  3. ecoolone
    Replies:
    0
    Views:
    797
    ecoolone
    Jan 3, 2008
  4. shahid

    subscript and superscript

    shahid, Feb 4, 2009, in forum: C++
    Replies:
    14
    Views:
    7,988
    James Kanze
    Feb 6, 2009
  5. dalei

    Turning a number to superscript

    dalei, Aug 23, 2005, in forum: Javascript
    Replies:
    8
    Views:
    143
    Robert
    Aug 27, 2005
Loading...

Share This Page