Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 Other Forums
 MS Access
 search for string with apostrophe

Author  Topic 

bciarcia
Starting Member

28 Posts

Posted - 2002-08-19 : 16:48:12
I am doing a search on an Access database that searches for a clients last name. Everything works fine until I get to a name like O'Brien. How do I do a search for this? I tried replacing the ' with '', but that doesn't work. Could someone please help me? I will also post this in the general SQL forum just in case.. Thanks in advance.

LarsG
Constraint Violating Yak Guru

284 Posts

Posted - 2002-08-19 : 18:28:12
Use two apsotophes like this


select * from person where lastName = 'O''brien'





Edited by - LarsG on 08/19/2002 18:28:41
Go to Top of Page

bciarcia
Starting Member

28 Posts

Posted - 2002-08-20 : 08:23:46
I tried that.. It doesn't work.. I will post my code to show you what I am doing. Actually.. never mind.. I just found my problem.. Dreamweaver was putting another replace() function in my connection string that changed it back to a single quote.. thanks for your help..

Go to Top of Page
   

- Advertisement -