I'm working on a SQL query that pulls information from a database into Excel. However, the source is from a website so I can't control what characters they use. I don't have the ability to edit the fields in the table.
I've run into an issue where the site uses the ' character sometimes in a field, which causes issues in my code:
Example Field: "Something's Here"
WHERE (Table.fieldName='Something's Here')
The ' causes an error, but I know I can just change the ' to '' through VBA in this case.
Are there any other characters that can cause issues? Perhaps ( or ) or - or ,
EDIT: Please note that I do not know PHP, and don't really understand what a prepared statement is or if that would work in my case. To reiterate, I am using Excel to import data via an ODBC connection. These are stored on Tables in Excel. The user inputs a number, which then updates the ODBC connections via VBA. There is a related field (that the user does not enter) based off the number the user entered that sometimes has characters that aren't allowed. I don't know that a prepared statement will be able to fix that.