I have the following string placed in a variable named [sName]:
.
Yura_(Girl's_Day)
.
Another variable named [sPhrase] is initialized with the following content:
.
sPhrase = "https://asianwiki.com/" & sName
.
This variable [sPhrase] is part of the following SQL command which is placed in the variable named [sSQL]:
sSQL = "UPDATE ""TActrices"" SET ""LinkAsianWiki"" = '" & sPhrase & "' WHERE ""ActriceID"" = " & sRecordID
.
This command is executed using these lines of code:
oConnect = ThisDatabaseDocument.CurrentController.ActiveConnection 'Connection DB
oStatement = oConnect.createStatement()
oStatement.executeQuery(sSQL)
.
However, the content was entered in the “LinkAsianWiki” field for the current record, but incompletely; the string entered in the field is: https://asianwiki.com/Yura_(Girl
.
.
What is even more curious is that all the form records for this field have been modified by this content. So all previous content has been replaced.
.
Is there a problem with using an Apostrophe in a string for an SQL command?