The key column information is insufficient or incorrect. Update affects multiple rows.

Source: Internet
Author: User

The program that raised the edit record tonight has tried several times and the results are incorrect. Let's take a look and find that the program stops running after a certain statement. This time I have experience. I wrote a statement on error goto in the process. In the Error Processing Section, stop it and then press the following text in the prompt window to get the following results:

? Error

The key column information is insufficient or incorrect. Update affects multiple rows.

Check online and findCoolOn the 11th floor of this post, it seems quite reasonable: after the client cursor is updated, ADO is responsible for communicating with the database. However, if there is no primary key information, the database cannot know which data ADO needs to update, in this process, you first call the update of ADO and then process the data to be updated at the bottom layer of ADO. However, when you select data, there is no primary key that uniquely represents the record, although there is only one data in your imagination, this is only a special case. It is more of a record set with many records, therefore, a primary key that uniquely represents a record is required for communication between ADO and databases.

My original SQL statement is written as follows:

Select tblmeal. bytmealtype, tblmeal. lngrecipeid from tblmeal where ......

The above two fields are not the primary key, so an error occurs. Later I changed it

Select tblmeal. idmeal, tblmeal. bytmealtype, tblmeal. lngrecipeid from tblmeal where ......

It is normal.

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.