Results 1 to 2 of 2

Thread: SQL WHERE statement with a field that contains ' or

  1. #1

    Thread Starter
    New Member
    Join Date
    May 2000
    Location
    Auckland, New Zealand
    Posts
    5

    Question

    Evening all

    Question: What is wrong with this code!! I'm doing a WHERE table = listview selection.

    "AND Bookings.Name = " " ' & lvwBookings.SelectedItem.Text ' " " " & _


    "AND Bookings.Address = ' " " & lvwBookings.SelectedItem.SubItems(1) & " " '; "

    I've spaced the quotes out just to show two of the combinations I've tried.

    I want to find names such as O'Connor and was told to surround the field with double quotes. I've tried sooo many combinations and hate is building quickly!

    Please help if you can.

    Thanks

  2. #2
    Junior Member
    Join Date
    May 2000
    Posts
    17
    Romper...

    You have to replace the ' that you get from the SelectedItem string with a '' (double ').


    -- mace

Posting Permissions

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



Click Here to Expand Forum to Full Width