Syntax Error of the update statement. Error code:-2147217900

Source: Internet
Author: User

When I recently used Asp.net and access for development, the SELECT statement is normal, but it is always unsuccessful during update, which triggers an oledbexception and reports "Update statement syntax error, error code:-2147217900"

When tracking, it is found that a separate SQL statement can be executed in access to find the cause and there is no result. Finally, I thought, is it because the keyword is used without being used?

Stringbuilder updatesql = "Update t_customer set name = ?, Company = ?, Address = ?, JJ = ?, Web = ?, ";
Updatesql. append ("email = ?, Join_date = ?, Zk = ?, Tel = ?, Stop_car = ?, ");
Updatesql. append ("bus_info = ?, Yysj = ?, Card = ?, Qz = ?, Area = ?, ");
Updatesql. append ("avg_lifecycle = ?, No_zk = ?, Bx_count = ?, Max_bx_person = ?, Min_bx_person = ?, ");
Updatesql. append ("max_person = ?, Flag = ?, Room_save_time = ?, Performance_save_time = ?, Tel_bak = ?, ");
Updatesql. append ("Sort = ?, Caixi_name = ?, Image = ?, Link = ?, State = ?, ");
Updatesql. append ("note =? ");
Updatesql. append ("where id =? ");

After adding "[]" to all the fields and table names above, try again. Everything is OK!

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.