Check the created
strQuery
string.
This line should probably handle quote characters in the item string but will effectively do nothing (replaces with the same characters):
strItem = strItem.Replace("''", "''");
[EDIT]
To perform the required replacement it should be:
strItem = strItem.Replace("'", "''");
[/EDIT]