Solved

Record/Key Deleted - Driving me batty!

Posted on 1998-05-20
8
700 Views
Last Modified: 2008-02-01
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
0
Comment
Question by:Pegasus100397
8 Comments
 
LVL 5

Expert Comment

by:ronit051397
ID: 1346820
Do use TQuery or TTable?
0
 
LVL 3

Author Comment

by:Pegasus100397
ID: 1346821
Edited text of question
0
 
LVL 3

Author Comment

by:Pegasus100397
ID: 1346822
Adjusted points to 256
0
 
LVL 1

Expert Comment

by:ssite
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...
0
How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

 
LVL 3

Author Comment

by:Pegasus100397
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 ;^)

Pegasus
0
 
LVL 1

Accepted Solution

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

and/or

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

Hope this Helps
RCJ
0
 
LVL 3

Author Comment

by:Pegasus100397
ID: 1346826
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
0
 

Expert Comment

by:JonathanElkins
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 :(

0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

A lot of questions regard threads in Delphi.   One of the more specific questions is how to show progress of the thread.   Updating a progressbar from inside a thread is a mistake. A solution to this would be to send a synchronized message to the…
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 gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…

708 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

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now