Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations John Tel on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Straight quotes vs smart quotes (curly quotes) in SQL

Status
Not open for further replies.

ptpaton

IS-IT--Management
Apr 22, 2003
124
US
Hi all. Just a brief warning. If you bring a large chunk of SQL into Microsoft Word to do mass edits on it, be careful to turn smart quotes off. Word will replace the straight quotes that Microsoft Access requires into smart quotes that make Access choke.

I spent 2 hours trying to figure out what was wrong with my code until I copied a line of SQL typed into Access and compared it with a line of code copy/pasted from Word. The only difference were curly or smart single and double quotes vs straight ones.

If you run into this problem, and Word turns all your quotation marks into curly ones, do the following in Word:
1. Format Menu > AutoFormat > Options Button > AutoFormat As You Type Tab
2. Click off "Straight quotes with smart quotes"
3. Now, find and replace " with ", and ' with '. Word will replace the smart quotes with straight ones.
4. Copy the code back into SQL.

Search the helpfile in Word for the same directions.

Ugh...I hope no one ever has to go through this again....

-Patrick

Nine times out of ten, the simplest solution is the best one.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top