Dynamic query and the embedded aprostophe ( ' )
Posted on 2008-06-19
I am having problems with using variables that may have an embedded aprostophe. Because single quotes (aprostophe) are wrappers for text strings in a query, my dynamic query finds one of those and assumes the end of a text string when there is more text to follow. I am looking for a parameter driven way of replacing the single quotes. I do not want to use a string function replacing " ' " with " ' ' "
Changing any sybase db parms is not viable.
strsql = strsql + " MID_ID = ' " & txtMidID.Text & " ' "
If txtMidID.Text = "AMERICA'S" then the dynamic query finds a false end to the text string and results in a query syntax error. Please provide a complete example with the solution