ASP + Access inexplicable SQL statement error solved

xiaoxiao2021-03-06  16

Sometimes the ASP is written with conn.execute (SQL) query, update, inserting Access database data, clearly correct statements often show SQL statement errors, quite annoying, special, and inappropriate, add "[", "]"solve:

Example 1:

Select * from A, if there is an error, can be changed to:

Select * from [A]

Example 2:

Update [user] set password = '"& data1 &"' where secname = '"& data2 &"' ", if there is an error, it can be changed to:

Update [user] set [password] = '"& data1 &"' where secname = '"& data2 &"' "example 3: INSERT INTO MyBook (Name, By, Mobile) VALUES ('" & Data1 & ",'" & Data2 & ", '"& data3 &") "If there is an error, it can be changed to: Insert Into MyBook ([Name], [BY], [Mobile]) VALUES ('" & Data1 & ", '" & Data2 & ",'" & Data3 & "' ) "

转载请注明原文地址:https://www.9cbs.com/read-58997.html

New Post(0)