I have successfully loaded a $dataSet with MS ACCESS data and need an If statement to replace apostrophes, AND other French characters with a preceding ESCAPE character to allow the building of the INSERT statement.
code snippet:
$strQryInsert = "Insert INTO tblNotice (noticeID,noticeName,noticeNameFrench)
VALUES(" + $dataset.Tables[0].Rows[0][0]+ ",'"`
+$dataset.Tables[0].Rows[0][1]+"','" `
+$dataset.Tables[0].Rows[0][2]+"');"
If I manually key in $dataset.Tables[0].Rows[0][2], I get the string text of the 3rd value that is in that row.
It is " Recherche dun emploi d'été?"
When the SQL statement is built, it errors on the single quote in the text. If I manually add an escape character (another single quote) to the source database, the INSERT statement builds fine.
Resultant text needs to be: Recherche dun emploi d''été?"
I'd like to create a conditional statement that would replace the row text with escape characters for any apostrophes and any other french characters that may interrupt the SQL insert statement build.
Another curious thing,, Some things I try manually fail to work in the script.