I'm creating test cocuments in Microsoft Word and once again am tripping over the issue of quotes ("", '). I document a simple insert statement in MS Word and copy-and-paste into isql and it fails.
insert into product (product_name) values ('ACME Corporation')
The error message is Unclosed quote before the character string '), a sure sign that the quote in the Word document isn't recognised. The problem is that Microsoft uses its own Ascii coding for quotes, and by default will replace the "straight" quote with its "smart" quote (known by everybody else as a "curly" quote - one commentator says that as a rule of thumb, every time Microsoft uses the term "smart" look for a gotcha).
One solution is not to use MS Word (Wordpad doesn't do this).
Another solution is to disable the curly quote in MS Word: under Tools; AutoCorrect Options; AutoFormat As You Type; deselect Replace Staight Quotes with Smart Quotes
Make sure that you are on the "AutoFormat As You Type" tab, not the Autoformat Tab.
Comments