Menu

#125 Error: INSERT INTO 语句的语法错误。

closed
nobody
2023-10-08
2023-10-07
Anonymous
No

Application version: 2.5.9.813

Steps to reproduce: Running this SQL:

INSERT INTO User(id, username, password)
VALUES ('0001','zhangsan','123456');
INSERT INTO User(id, username, password)
VALUES ('0002','lisi','12345');
INSERT INTO User(id, username, password)
VALUES ('0003','wangwu','1234');

Expected results:

Actual results: EOleException: INSERT INTO 语句的语法错误。

Additional Information: Windows 10 Home China / ACE driver not found

Discussion

  • Marciel Degasperi

    • status: --> closed
     
  • Marciel Degasperi

    Hi, thanks for reporting.

    The terms “user” and “password” are reserved words in SQL. To use them as column names, you need to add square brackets to them. See the example below:

    INSERT INTO [User](id, username, [password])
    VALUES ('0001','zhangsan','123456');
    INSERT INTO [User](id, username, [password])
    VALUES ('0002','lisi','12345');
    INSERT INTO [User](id, username, [password])
    VALUES ('0003','wangwu','1234');
    

    It is not recommended to use reserved words as database element identifiers. Try choosing different names for the tables and columns to avoid this type of problem.

     

Anonymous
Anonymous

Add attachments
Cancel