Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 635105
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T20:22:06+00:00 2026-05-13T20:22:06+00:00

I am doing a site in asp. when i start a search with a

  • 0

I am doing a site in asp.

when i start a search with

a name like this o’neil

i’m getting a database error.

i’m getting this error because of that ‘ in that name.

how can i remove this error in asp.

if its in asp we can use addslashes and stripslashes but how can i do this in asp???

Please help

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-13T20:22:06+00:00Added an answer on May 13, 2026 at 8:22 pm

    Whether it is for SELECTing a particular string value or for INSERTing it into the database, the string must be valid for SQL, specifically:

    • The start of the string is marked by a single quote character
    • Any single quote that is part of the string must be doubled (lest SQL understands it as the end of the string)
    • The end of the string is marked by a single quote.

    Therefore

      'O''Neil'
    

    is the proper way to “code” the name O’Neil, because if we used

      'O'Neil'
    

    instead, SQL would see this as a string, starting with the letter O, but ending there after. This single letter string is then followed by the expression Neil' which SQL cannot understand.


    The above information will allow you to store the names and to query for them in a way which preserves the single quotes embedded in names as with the Irish O’xxxx.
    Beyond helping you fix this situation, I’d be remiss if I forgot to mention the risks of SQL injection.

    Now that you understand that a non-doubled single quote will terminate the string, you can see how malicious users may use this to “trick” the application.
    For example let’s say the user somehow guessed that the table in use is search, he/she may go ahead and fill in the following string in the edit box of the application

      O'; DELETE FROM search where 'a%'='a
    

    Your logic will use this string as follow

    Lstart="O'; DELETE FROM search where 'a%'='a"; select * from search where lname like '%Lstart%'
    -- which effectively will be substituted as
    select * from search where lname like '%O';  DELETE FROM search where 'a%'='a%'
    

    Which, if the account associated with the underlying SQL connection is so authorized , will result in deleting all rows from the table, and leaving your application broken !

    By systematically doubling the single quotes, and with a few other precautions, such as the use of parametrized queries, it is possible to protect the application (and its database) from this type of attacks.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

No related questions found

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.