Sometimes when writing ASP and using conn.execute(sql) to query, update, and insert Access database data, the sql statement error often appears when the statement is clearly correct, which is quite annoying. I have specially summarized it. You can add "[", " "]" Solution:
Example 1: select * from a
If an error occurs, it can be changed to: select * from [a]
Example 2: UPDATE [user] SET password = '"&data1&"' where secname='"&data2&"'"
If an error occurs, you can change it to: UPDATE [user] SET [password] = '"&data1&"' where secname='"&data2&"'"
Example 3: INSERT INTO mybook ( name, by, mobile ) VALUES ('"&data1&" ','"&data2&"','"&data3&"')"
If an error occurs, change it to:
INSERT INTO mybook ( [name], [by], [mobile] ) VALUES ('"&data1&"','"&data2&"','"&data3&"')"