Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

*** URGENT *** DataGrid Update ERROR

Status
Not open for further replies.

dwong

Programmer
Aug 8, 2001
20
AU
I have a simple MS Access 97 table bound through an ADO and Datagrid. The Datagrid display correctly the content of the table, but when it comes to updating existing cells, the following errors occurs:

1) The error message "Key Column information is insufficient or incorrect. Too many rows were affected by update" .... This is true in that if I updated one entry thats OK, but anything more than 3 updates, I would get this message. Please note that the table do not have any key, it is a very simple table.
2) After I get the above message, I exit out of the Datagrid FORM, i than get another message "Row cannot be located for updating. Some values may have been changed since it was last read".

Ironically, even though I get the above 2 messages, the update I performed was updated back to the table successfully. Furthermore, I have downloaded/installed MicroSoft Service Pack 3.0 and 4.0. It resolevd the problem partially, in that if the Datagrid, displays less than 1 page worth of rows, I don't get the above messages, until more rows were displayed through the Datagrid.

I would appreciate your assistance as I have User Testing in 2 days time.

Thanks and regards...
 
This sure sounds like a problem in your record source of your ado control, you're probably selecting records from more than one table, using Inner Joins or selecting only some fields of that table.

Plz show the record source statement.

I had some problems when I try to select only some fields of the table. Try to make a select * from table on your ADOdc record source and then just hide the fields you don't need on the data grid and see if it's working.

If you're using Inner Joins that is a different thing. Anyway try this out and if it still doesn't work let me see what you are using for record source.
 
Hi daimaou,

Thanks for your prompt reply.

The Recordsource I am using is adCmdTable. Initially I did use a SELECT * SQL, but found that it was not able to perform any updates. With adCmdTable, I could perform the updated, but get the 2 erraneous messages.

As you had mentioned, with all the fields from the table grabbed in suppressed the columns I do not need from the Datagrid.

Thanks and regards...
 
Hi daimaou,

The problem above is resolved. In my case, I decided to define a primary key to the table. Apparently, the datagrid gets confused as to which update I was doing. With a key, it was able to keep track of each update accordingly.

Thanks for your assistance into this matter.

Thanks and regards...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top