Board index » delphi » A bug in BDE: Couldn't perform the edit because another user changed the record

A bug in BDE: Couldn't perform the edit because another user changed the record

I have a TTable connected to a MSSQL 7 view on two joined tables (Defects,
Bugs) on their primary keys (relation one to zero or one)
(Delphi 4, BDE 5.01 idapi32.dll 5.0.1.22 sqlmss32.dll 5.0.1.23)
UpdateMode is set to upWhereKeyOnly

The view "Defects_ViewBugs" is build on two tables:
CREATE VIEW Defects_ViewBugs AS
select Defects.*, Bugs.*
  from Defects left join Bugs on Bugs.Bug = Defects.DefectID

When I am trying to edit a record which does not include record from the
Bugs table I get permanent
"Couldn't perform the edit because another user changed the record"

I have investigated the problem using SQL Profiler.

Before editing the record BDE queries the database:
SELECT COUNT(*)  FROM Defects_ViewBugs WHERE DefectID=94 AND Project=1 AND
Exception='ERegisterDefect' AND Address='0012FB6C' AND Build='0.0.2.9' AND
Computer='DEEPPURPLE' AND Contributed='Oct 14 1999 11:04:25.310 ' AND
Processed=0 AND Contributer='KSF\Eugene' AND IsBug=0 AND Bug IS NULL  AND
Reviewed IS NULL  AND RegisteredBy IS NULL  AND Responsible IS NULL  AND
Fixed=0 AND WhenFixed IS NULL

This SQL statement returns 0. The same statement without "Fixed=0" removed
it returns 1

The field "Fixed" has been created with (not null default 0) option.

Actually, the correct SQL statement should use "Fixed is null" istead of
"Fixed=0"

 

Re:A bug in BDE: Couldn't perform the edit because another user changed the record


Eugene,

   Yes, it's a bug in the BDE.  The best solution is to use TQuerys and
CachedUpdates (stay away from TTables).

Good luck,
krf

Quote
Eugene M. Hutorny wrote in message <7u6m1k$c...@forums.borland.com>...
>I have a TTable connected to a MSSQL 7 view on two joined tables (Defects,
>Bugs) on their primary keys (relation one to zero or one)
>(Delphi 4, BDE 5.01 idapi32.dll 5.0.1.22 sqlmss32.dll 5.0.1.23)
>UpdateMode is set to upWhereKeyOnly

>The view "Defects_ViewBugs" is build on two tables:
>CREATE VIEW Defects_ViewBugs AS
>select Defects.*, Bugs.*
>  from Defects left join Bugs on Bugs.Bug = Defects.DefectID

>When I am trying to edit a record which does not include record from the
>Bugs table I get permanent
>"Couldn't perform the edit because another user changed the record"

>I have investigated the problem using SQL Profiler.

>Before editing the record BDE queries the database:
>SELECT COUNT(*)  FROM Defects_ViewBugs WHERE DefectID=94 AND Project=1 AND
>Exception='ERegisterDefect' AND Address='0012FB6C' AND Build='0.0.2.9' AND
>Computer='DEEPPURPLE' AND Contributed='Oct 14 1999 11:04:25.310 ' AND
>Processed=0 AND Contributer='KSF\Eugene' AND IsBug=0 AND Bug IS NULL  AND
>Reviewed IS NULL  AND RegisteredBy IS NULL  AND Responsible IS NULL  AND
>Fixed=0 AND WhenFixed IS NULL

>This SQL statement returns 0. The same statement without "Fixed=0" removed
>it returns 1

>The field "Fixed" has been created with (not null default 0) option.

>Actually, the correct SQL statement should use "Fixed is null" istead of
>"Fixed=0"

Re:A bug in BDE: Couldn't perform the edit because another user changed the record


I have a same message when i wanted to modify Query with two or more tables

I use
Query (CachedUpdates:=True) and TupdateSql

Other Threads