Delphi update语句修改SQLite数据库表出现 SQLiteException: unrecognized token:的错误原因

    xiaoxiao2022-07-13  157

    一般都是SQL语句引号''''错误:

    可参考下面的正确写法:

    //参考下面的正确写法 SQL.Add('update COMM set 学生编号='''+trim(edit1.Text)+''',学生姓名='''+trim(edit2.Text)+''',学生年龄='''+trim(edit3.Text)+''',学生性别='''+trim(edit4.Text)+''',所在大学='''+trim(edit5.Text)+''',联系方式='''+trim(edit6.Text)+''',出生年月='''+datetostr(DateTimePicker1.Date)+''',入学时间='''+datetostr(DateTimePicker2.Date)+''' where 学生姓名='''+trim(Sname)+'''');

     或者采用QuotedStr函数:

    QuotedStr(UniQuery1.FieldByName('cum1').AsString)

     

    最新回复(0)