Too Many Quotes
Posted on 1998-06-09
I"m using SQL to insert a line into a database. It also uses a variable, so it looks like this
SQL = "INSERT INTO DATABASE (name) VALUES (' " & MyRs("name") & " ')"
The SQL statement then equals: INSERT INTO DATABASE (name) VALUES ('John Doe')
This works fine, but then I found a case where it crashes. If the name has an apostrophee.
ie. INSERT INTO DATABASE (name) VALUES ('John O'Conner')
There are too many quotes, and the program crashes.
How can I solve this?