Board index » delphi » Access File 'Key Violation' problem

Access File 'Key Violation' problem

Try changing your TQuery or TTable to UpdateMode=upWhereKeyOnly and see if
that fixes it.  If you try to update the record by all fields, you get a
tremendous SQL statement on some tables with a lot of fields.  Make sure
that you have a primary key on the table you are working on.

Ryan McGinty
OCERIS, Inc.

Quote
Jack V. wrote in message <79dnfs$me...@forums.borland.com>...
>When I update Access file, I got an exception with message 'Key Violation.
>[Microsoft ODBC Access 97 Driver] Query is too complex' from BDE Desktop
and
>from application itself. However, I have tried update the same table from
MS
>Access or from Delphi its native driver, I found no error. Please advise
me,
>how to solve the problem.

 

Re:Access File 'Key Violation' problem


Hi,
When I update Access file, I got an exception with message 'Key Violation.
[Microsoft ODBC Access 97 Driver] Query is too complex' from BDE Desktop and
from application itself. However, I have tried update the same table from MS
Access or from Delphi its native driver, I found no error. Please advise me,
how to solve the problem.
Jack V.

Re:Access File 'Key Violation' problem


That's a good answer.  Also, if you are using a version of the BDE before
4.01, upgrading it may help.
Quote
Ryan McGinty wrote in message <79dog7$me...@forums.borland.com>...
>Try changing your TQuery or TTable to UpdateMode=upWhereKeyOnly and see if
>that fixes it.  If you try to update the record by all fields, you get a
>tremendous SQL statement on some tables with a lot of fields.  Make sure
>that you have a primary key on the table you are working on.

>Ryan McGinty
>OCERIS, Inc.

>Jack V. wrote in message <79dnfs$me...@forums.borland.com>...
>>When I update Access file, I got an exception with message 'Key Violation.
>>[Microsoft ODBC Access 97 Driver] Query is too complex' from BDE Desktop
>and
>>from application itself. However, I have tried update the same table from
>MS
>>Access or from Delphi its native driver, I found no error. Please advise
>me,
>>how to solve the problem.

Other Threads