Hi. I have the code below which inserts a record into an iOSSQLite table. This works fine during testing most of the time until the one time it threw an error. I found that one of the fields where the error occurred contained an apostrophe. I did a little reading that the approach for this is to use prepared statements. However, I don’t see SQLitePreparedStatement or iOSSQLitePreparedStatement as an option for iOS.
dim sqlAddIncorr as Text
sqlAddIncorr = "INSERT INTO incorrect (ProgID, RefID, Test, AnswerCode, Correct, DomainNumber, " +_
"UsersChoice, Redeem, Question, Answer1, Answer2, Answer3, Answer4, Solution)" +_
"VALUES ('" + ProgID + "', '" + valID.ToText + "', '" + IncorrTestSet + "', " +_
"'" + CorrectAnswerCode.ToText + "', '" + IncorrCorrect + "', " +_
"'" + IncorrDomNum + "', '" + IncorrUserChoice + "', '" + IncorrRedeem + "', " +_
"'" + txtQuestion.Text + "', '" + txtAnswer1.Text + "', '" + txtAnswer2.Text + "', " +_
"'" + txtAnswer3.Text + "', '" + txtAnswer4.Text + "', '" + theSolution + "');"
app.dbUser.SQLExecute(sqlAddIncorr)
Any suggestions on how to insert a field containing an apostrophe for iOS? We cannot use DatabaseRecord in iOS, right?