Re: Key column information insufficient....ERROR
From: Stephen Howe (stephenPOINThoweATtns-globalPOINTcom)
Date: 12/30/04
- Next message: Stephen Howe: "Re: MDAC Version List"
- Previous message: Stephen Howe: "Re: ADO 2.7 performance"
- In reply to: Ashwin: "Key column information insufficient....ERROR"
- Messages sorted by: [ date ] [ thread ]
Date: Thu, 30 Dec 2004 13:04:42 -0000
> While updating a recordset pulled from an access table through ADO, I am
> getting this error:
>
> "Key column information is insufficient... affect multiple records...."
>
> and multiple records get updated with same data.
>
> MSDN is at no help...Any suggestion?
Make sure you SELECT all fields that make up your PK from your table in your
recordset even if you don't use that field. The Recordset when updating
_HAS_ to be able to find the row to update and it uses the PK to do just
that. If you select only some of the fields in your Recordset that make up
the PK, ADO has no way of knowing which row to update, hence your message.
e.g.
If your PK consists of field1,field2 on a table and there is also field
3,field5 then doing a recordset based on
SELECT field1,field3 FROM table1
and you change field3
is not updateable because field2 is absent. It has to be
SELECT field1,field2,field3 FROM table1
(Note: There are other ways of helping ADO update a recordset but they are
more unusual)
Stephen Howe
- Next message: Stephen Howe: "Re: MDAC Version List"
- Previous message: Stephen Howe: "Re: ADO 2.7 performance"
- In reply to: Ashwin: "Key column information insufficient....ERROR"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|
|