PDA

Click to See Complete Forum and Search --> : SQL WHERE statement with a field that contains ' or


Romper
May 28th, 2000, 05:04 PM
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

mace
May 28th, 2000, 10:05 PM
Romper...

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


-- mace