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

x
?
Solved

DataBase

Posted on 2006-05-26
5
Medium Priority
?
168 Views
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 :
delete
from table
where title=:'title'

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

regards
0
Comment
Question by:ibrobar
  • 2
3 Comments
 
LVL 3

Expert Comment

by:dygj
ID: 16768032
Is the : a typo or?

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

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

Author Comment

by:ibrobar
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

0
 
LVL 3

Accepted Solution

by:
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?

0

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