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



Posted on 2006-05-26
Medium Priority
Last Modified: 2010-04-05
Hi I am using paradox table and the key of my table is AutoIncrement field
The problem is when I am doing Delete for one of the records i am getting the key violation error message
More information about the program is that i am filling a listview with that table and i am doing the delete by clicking on selected item in the listview by recalling this query :
from table
where title=:'title'

The field Title is the second field in my table and it's a string field

Question by:ibrobar
  • 2

Expert Comment

ID: 16768032
Is the : a typo or?

for tquery the sql should be:
delete from table where title='title'

delete from table where title=:myparams
and with a parameter you must provide a value for the parameter.
myquery.params[0].asstring='my title';

Author Comment

ID: 16768475
I think you didn't get my question exactly I am not having a problem with the query or the sql statement .
The problem is when i delete fields from a table it's key based on autoincrement field it's giving me key violation message cause i think it's making gaps in the key field and i want a solution for this problem


Accepted Solution

dygj earned 1000 total points
ID: 16853526

can you delete a record using the database desctop?
if no : Any referential integreties or validy checks enabled ?

if yes:
Do you add records to your database from the listview?
 - are they posted to the database?


Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

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

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…
Loops Section Overview
Is your OST file inaccessible, Need to transfer OST file from one computer to another? Want to convert OST file to PST? If the answer to any of the above question is yes, then look no further. With the help of Stellar OST to PST Converter, you can e…

581 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