Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 631
  • Last Modified:

TTable update error - record has been changed by another user

I am working with Delphi 5 Enterprise, and accessing a MSSQL 7.0 database through the native MSSQL BDE driver.  On a table that I am trying to update opened with a TTable object, when I call Edit, I get the error message "Couldn't perform update because the record has been changed by another user".  Append works just fine.

On Borland's site, I found two references to this, one relating to Sybase and CTLIB with small datetimes, and the other on using SET NOCOUNT ON.  Neither of these applies to my situation.

Other tables are updating just fine, and I don't see anything obviously wrong.

Any help would be greatly appreciated.  Thank you.
0
pakman
Asked:
pakman
  • 3
  • 2
1 Solution
 
kretzschmarCommented:
?maybe

try to change the updatemode-property of the ttable  to upwherekeyonly
0
 
pakmanAuthor Commented:
I had tried setting UpdateMode to upWhereChanged earlier, that didn't work.  I just tried your solution, and that didn't do anything either.
0
 
YodaMageCommented:
Do you have a before update trigger? Just a shot in the dark here...
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
kretzschmarCommented:
something from this table must be different from the others tables

as yodamage said are there triggers
or checks or autonumber fields?

the problem seems to be that the record cannot be reallocated before update

maybe it helps to set the cachedupdates to true and call
the applyupdates in the afterpost-event
(with upwherekeyonly in the updatemode-property)

or
using a tquery instead a ttable with a TUpdateSQL as UpdateObject (property of TQuery)

meikl ;-)
0
 
pakmanAuthor Commented:
Setting CachedUpdates to True and UpdateMode to upWhereKeyOnly did the trick.

Thank you.

Paul
0
 
kretzschmarCommented:
well, glad you got it work,
thanks for the points :-)

good luck again

meikl ;-)
0

Featured Post

Get your problem seen by more experts

Be seen. Boost your question’s priority for more expert views and faster solutions

  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now