Record/Key Deleted - Driving me batty!

Posted on 1998-05-20
Last Modified: 2008-02-01
I have a table in SQL Server 6.0 hooked to a TTable Component defined as:


The primary key is on CP_Counterparty

When I bring up a DataGrid and attempt to modify CP_Description (with no key or index on it!) I get a
"Record/Key Deleted" error. This happens even though I AM NOT modifying the primary key field.

I remember this error from Delphi 1.0 but have long since forgotten the workaround.

Any ideas on what is causing this? Thanks in advance!
Question by:Pegasus100397
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions

Expert Comment

ID: 1346820
Do use TQuery or TTable?

Author Comment

ID: 1346821
Edited text of question

Author Comment

ID: 1346822
Adjusted points to 256
Technology Partners: 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!


Expert Comment

ID: 1346823
I don't use these components, but the message says RECORD/key deleted. Could it be that the record in the dataset has already been deleted ?

A couple of other long shots, is maybe one of these fields is null and the delphi TQuery of TTable doesn't respond well to it ?

Tell me if I'm in the right direction...

Author Comment

ID: 1346824
Thanks ssite,

 I've pointed the TTable off to a test-table (looks the same as the old one) so I _know_ the record is still there. I've been stuck on this for three days now. The primary key is on the CP_Counterparty and when I edit the description KABLOOM! "Record/Key Deleted". I've even tried playing around with the UpdateMode on the TTable. It will then let me edit the record as it should, but when a description is edited, the rows shift all over the place in my DBGrid. Why it's doing that I don't have a clue.

I've went so far as to start a completely new "clean" app that just has the Database, TTable, Datasource, Grid & Navigator on it. Same thing happens, so I know it's not a mysterious bug in my origional app.

I've had some preliminary success with using a TQuery component (Live result set) instead of the TTable component. The SQL looks like this:

Select * from COUNTERPARTY order by CP_Counterparty

So far it let's me edit ok but I'd rather find out why the TTable is going bonkers.

Thanks for your help and sorry for the long comment ;^)


Accepted Solution

RJENKINS earned 400 total points
ID: 1346825
Try Changing the Table.UpdateMode to upWhereKeyOnly


Set the BDE Sybase lang driver to Sybase SQL Dic850 in the BDE.

Hope this Helps

Author Comment

ID: 1346826

 Excellent!!! Although the UpdateWhereKeyOnly didn't work, changing the language driver to "Sybase SQL Dic850" in the BDE solved the problem immediately! It was perviously set to "blank" or none.

I would never have guessed that this was what was causing the goofy TTable behaviour!

With the quality of the answer right up there with the best, I've awarded you 400 points. Thanks!

I am very curious what the Language Driver actually does in the BDE, I can't seem to find any information on it. Can you enlighten the rest of us?

Thanks again for your timely response, my project is now back on track.

Expert Comment

ID: 32707554
I have had this problem randomly for years in my Interbase/Delphi/BDE application.

I tried setting TTable.UpdateMode = UpdateWhereKeyOnly and still I get RECORD/KEY DELETED.
I tried setting BDE Language Driver to "Sybase SQL Dic850" and still I get RECORD/KEY DELETED.

You get no points from me :(


Featured Post

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

This article explains how to create forms/units independent of other forms/units object names in a delphi project. Have you ever created a form for user input in a Delphi project and then had the need to have that same form in a other Delphi proj…
Have you ever had your Delphi form/application just hanging while waiting for data to load? This is the article to read if you want to learn some things about adding threads for data loading in the background. First, I'll setup a general applica…
This video Micro Tutorial shows how to password-protect PDF files with free software. Many software products can do this, such as Adobe Acrobat (but not Adobe Reader), Nuance PaperPort, and Nuance Power PDF, but they are not free products. This vide…
NetCrunch network monitor is a highly extensive platform for network monitoring and alert generation. In this video you'll see a live demo of NetCrunch with most notable features explained in a walk-through manner. You'll also get to know the philos…

734 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