I have a very simple search cursor that is selecting from a table a list of names in order to query a database. It was working fine until I encountered a name with an apostraphe in it. O'Brien for instance. The search cursor is very basic.
inCur = gp.SearchCursor(myFeatureClass2,"COLLECTED_BY = '" + str(Name) + "'", "", "", "DATE_COLLECTED A")
The term Name is retrieved from a list of values. When run it gets to O'Brien in the list and says that a value cannot be found. I know this is happening because of the single quotes that are around my input variable however I can't seem to find another way to word my search cursor to still find the names.