Unidentified syntax error in SQLiteDatabase.ExecuteSQL statement


There must be something really simple that I am missing, but could someone tell me why I am getting a DatabaseException with this code:

Private Sub SaveEmailRecord(subject As String, body As String, recipients() As String)
  'TABLE EmailRecords
  Var sql As String
  sql = "INSERT INTO EmailRecords(Recipients,Subject,Body,SentDate) VALUES(?,?,?,?)"
  Var recipientlist As String = String.FromArray(recipients, ", ")
  'MainDatabase is a connected SQLiteDatabase
  'recipientlist has the value "Frank Sun <my_address@gmail.com>"
  MainDatabase.ExecuteSQL(recipientlist, subject, body, DateTime.Now.SQLDate)
End Sub

On the ExecuteSQL line a DatabaseException occurs with
ErrorNumber: 1
Message: near “Frank”: syntax error

According to sqlite.org, error code 1 is SQLITE_ERROR /* Generic error */

Someone please point out what silly mistake I have made!

recipientlist in ExecuteSQL but Recipients in sql string

I might have not read this right as I’m on my phone and it is small

Oh I just spotted it – I didn’t include sql as the first parameter to the call to ExecuteSQL! :man_facepalming:

Good deal! :+1: