PDA

Click to See Complete Forum and Search --> : SQL question using DAO...Concerning Quotes


cvaden
Feb 13th, 2000, 10:58 AM
Example SQL statement:

txtTitle.Text = "Frame's"

"SELECT Titles as intTitle WHERE Title = '" & txtTitle.Text & "'"

It gives me an error referring to the single quotation in Frame's.

I tried replacing the Frame's with Frame\'s and even Frame/'s but it still didn't like it. If I remove the single quote then it behaves properly!

How can I fix this? I would like NOT to eliminate single quotes from my database!

Thanks in advance!

<c>

Clunietp
Feb 13th, 2000, 01:11 PM
Use 2 single quotes in place of a double quote

If you have VB6, you can use the REPLACE function to easily do this for you

cvaden
Feb 14th, 2000, 07:59 AM
Maybe I didn't make myself clear...

User wants to search for an item in the database.

The item is Frame's, so they type frame's.

But it doesn't return frame's because of the single quotation or apostrophy or whatever it's called.

My question is how do I allow them to search for something that has a single quote in it.

<c>

Clunietp
Feb 14th, 2000, 12:47 PM
Sorry, I mistyped

Use two single quotes instead of one single quote when searching


...Just try it

cvaden
Feb 14th, 2000, 08:30 PM
Thanks, Clunietp.

Seems to be working fine now.

<c>