Link to home
Start Free TrialLog in
Avatar of Pegasus100397
Pegasus100397

asked on

Record/Key Deleted - Driving me batty!

I have a table in SQL Server 6.0 hooked to a TTable Component defined as:

CP_Counterparty
CP_Description

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!
Pegasus
Avatar of ronit051397
ronit051397

Do use TQuery or TTable?
Avatar of Pegasus100397

ASKER

Edited text of question
Adjusted points to 256
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...
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 ;^)

Pegasus
ASKER CERTIFIED SOLUTION
Avatar of RJENKINS
RJENKINS

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
RCJ,

 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.
Pegasus
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 :(