Syntax Error with Query

后端 未结 1 1796
隐瞒了意图╮
隐瞒了意图╮ 2021-01-20 01:13

I would like to use an Insert Into query in Delphi XE2 to insert a user\'s information into a MS Access Database. The problem is I keep getting the same error:<

1条回答
  •  梦毁少年i
    2021-01-20 01:39

    PASSWORD is a reserved word in Access so if you use it as a column name you must enclose it in square brackets.

    Try this instead:

    DB.SQL.Add('INSERT INTO tblUsers ');
    DB.SQL.Add('(FirstName,Surname,Username,[Password],Grade) ');
    

    0 讨论(0)
提交回复
热议问题