Solved

TTable update error - record has been changed by another user

Posted on 2001-08-23
6
608 Views
Last Modified: 2010-04-04
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
Comment
Question by:pakman
  • 3
  • 2
6 Comments
 
LVL 27

Expert Comment

by:kretzschmar
ID: 6418718
?maybe

try to change the updatemode-property of the ttable  to upwherekeyonly
0
 

Author Comment

by:pakman
ID: 6419547
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
 
LVL 4

Expert Comment

by:YodaMage
ID: 6419784
Do you have a before update trigger? Just a shot in the dark here...
0
What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

 
LVL 27

Accepted Solution

by:
kretzschmar earned 150 total points
ID: 6419849
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
 

Author Comment

by:pakman
ID: 6422002
Setting CachedUpdates to True and UpdateMode to upWhereKeyOnly did the trick.

Thank you.

Paul
0
 
LVL 27

Expert Comment

by:kretzschmar
ID: 6424527
well, glad you got it work,
thanks for the points :-)

good luck again

meikl ;-)
0

Featured Post

Problems using Powershell and Active Directory?

Managing Active Directory does not always have to be complicated.  If you are spending more time trying instead of doing, then it's time to look at something else. For nearly 20 years, AD admins around the world have used one tool for day-to-day AD management: Hyena. Discover why

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
delphi prevent click fast 2 218
FMX StringGrid1->Canvas->FillRect Problem 3 151
Process Javascript errors with Delphi TWebBrowser 1 132
RESTRequest Parameter 4 30
Hello everybody This Article will show you how to validate number with TEdit control, What's the TEdit control? TEdit is a standard Windows edit control on a form, it allows to user to write, read and copy/paste single line of text. Usua…
Introduction I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…
This video shows how to use Hyena, from SystemTools Software, to bulk import 100 user accounts from an external text file. View in 1080p for best video quality.
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

773 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question