>One use of STRTRAN() would be to replace a single-quote with TWO single-quotes. SQL will accept this. On retrieval, however, you will see the 2 quotes. Would you STRTRAN() them on the fly back to ONE single quote ? Where would that happen ?
You need to do something like this:
lcString = "'" + STRTRAN(tuValue, "'", "''") + "'"
Use STRTRAN to convert the single quote to double single quotes to get the value into SQL. SQL will interpret this to mean, basically, "here comes a single quote". It will be stored in the table as "Mike's Pizza" and not "Mike''s Pizza" so you won't have to worry about retranslating it.
Dan LeClair
www.cyberwombat.comSET RANT ON - The Wombat BlogLife isn’t a morality contest and purity makes a poor shield. - J. Peter MulhernDisclaimer: The comments made here are only my OPINIONS on various aspects of VFP, SQL Server, VS.NET, systems development, or life in general, and my OPINIONS should not be construed to be the authoritative word on any subject. No warranties or degrees of veracity are expressed or implied. Void where prohibited. Side effects may included dizziness, spontaneous combustion, or unexplainable cravings for dark beer. Wash with like colors only, serve immediately for best flavor.