Posted on 2006-05-26
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
    LVL 3

    Expert Comment

    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

    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

    LVL 3

    Accepted Solution


    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?


    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    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

    Suggested Solutions

    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…
    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…
    To add imagery to an HTML email signature, you have two options available to you. You can either add a logo/image by embedding it directly into the signature or hosting it externally and linking to it. The vast majority of email clients display l…
    Sending a Secure fax is easy with eFax Corporate ( First, Just open a new email message.  In the To field, type your recipient's fax number You can even send a secure international fax — just include t…

    761 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

    11 Experts available now in Live!

    Get 1:1 Help Now