SitePoint Sponsor

User Tag List

Results 1 to 3 of 3

Thread: Access Search

  1. #1
    SitePoint Evangelist
    Join Date
    Oct 2001
    Location
    Texas
    Posts
    598
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Access Search

    I am writing a program to search an Access Database using SQL and ASP. In my database i have cells that contain apostrophes in them... that poses a problem when someone enters and single quote to search because the SELECT * FROM table WHERE name=mike's gives me an error because of the apostrophe.

    How can i do this?

  2. #2
    SitePoint Wizard dethfire's Avatar
    Join Date
    Aug 2000
    Posts
    2,477
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    right, the apostrophe is a SQL delimiter

    what you can do is run the replace() on your search query. substitute all apostrophes to lets say a pound sign. then when you want to display the result run the replace() again to substitute the pound sign with theapostrophe. make sense?
    Free Science Homework Help
    http://www.physicsforums.com

  3. #3
    SitePoint Wizard
    Join Date
    Jan 2001
    Location
    Milton Keynes, UK
    Posts
    1,011
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Wbmstr84,

    Have a look at this faq from 4Guys as it explains the problem and shows the solution.


Bookmarks

Posting Permissions

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