You do have a problem. Your sSQL variable appears to contain a value that is enclosed in single quotes which results in an extra set of enclosing single quotes in your query.
You must only have one set of single quotes in your generated sql string.
The result from the error message:
Code:
bar_mob_no IN(''44444444'') or bar_alt_mob in(''44444444'')
What you want generated in your strSql:
Code:
bar_mob_no IN('44444444') or bar_alt_mob in('44444444')
Of course, that is assuming that the data type for bar_mob_no is some kind of text and not numeric. If you are using a numeric data type you don't want the single quotes at all.
Woody Z
http://www.learntoprogramnow.com