dummie

dummie

  • NA
  • 12
  • 0

Urgent question about Updates

Sep 12 2005 12:04 AM

Hi

I have 4 fields as my pk in access db.. I query for data in VS.NET 2003. I query by id AND pwd.. I can view the data in datagrid, but not update properly.

When i update it says:
The changes you requested to the table were not successful because they would create duplicate values in the index, pk, or relationship. Change the data in the field or fields that contain duplicated data, remove the index, or redefine the index to permit duplicate entries and try again.

I tried to solve the problem by going to access db and changed the 'Indexed' properties (of the 4 fields i used as my pk) from 'No' to 'Yes (Duplicates OK)'. but still i get the same error when i edit values in datagrid and click on update.

Something puzzling is, when i click on view button after i update, i can see the latest AND first updated entry in my datagrid and access db. The previously edited data is changed back to the original value again.

so what im saying is,
eg. row1) 4
    row2) 4
    row3) 4

I changed row2) from 4 to 5 and press update. the error msg is shown. then, i press View button. i see:
    row1) 4
    row2) 5
    row3) 4

Now i change row3) from 4 to 3. again, error is shown. now i see:
    row1) 4
    row2) 4
    row3) 3
I tried playing with it, i update both row1) and row2) at the same time. I changed row1) to 5 and row2) to 6 and i see:
    row1) 5
    row2) 4
    row3) 4

What's happening and what must i do exactly?? Please help asap. Thank you!