Record/Key deleted problem

Freerider
Freerider used Ask the Experts™
on
Hi experts,

I have a table containing Customer details which I display in a DBCtrlGrid using a TTAble - couldn't be simpler.
In the Grid, I have the name and a selection box.

The problem I have is when selecting certain records, I get the error message "Record/Key deleted" this happens for the same customers every time, others will select/deselect ok.

Why do I get this error? I have been trying everything to get rid of it!

I am still trying different things as I write! I've noticed the problem goes away if I remove the Primary Key for the Customer table.

Will I get other problems if I do this?

Thanks,
Freerider.
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®

Commented:
What database are you used?
This probably index problem, as only happend in certain records. Reindex the table maybe resolve your problem.

Regards,
Dewo

Author

Commented:
I'm using an Access database.
I'm not sure how to reindex it. Do I just delete the index and create it again? This doesn't solve the problem though.

Commented:
I stopped using access as a back end (voluntarily anyways) because of just such flakiness.  I switched to Interbase and the problems went away.
JavaScript Best Practices

Save hours in development time and avoid common mistakes by learning the best practices to use for JavaScript.

Author

Commented:
This is very wierd. Can anyone explain this?

In the database, some of the Customer ID's were UPPERCASE (CAPELLI) and some weren't (Capelli).

All but one of the 'C's were CAPS, so I changed them to lowercase, and I don't have any problems.

It doesn't make any sense, but at least the problem's gone.
Whoever can come up with a believable explanation for this, gets the points.

Freerider.

Commented:
Access is sometimes case sensitive and other times not.  If you don't explicitly control it carefully you can get unexpected side effects.

Commented:
This because you use text as Primary Key. If you do so, in other circumstance of edit, set the control to that ID field as read only. It can change only when the record in insert state. And mask it as uppercase/lowercase all.

Another solution is set ID field as Number/AutoNumber that will not face case-sensitivity problem.

Hope this will help.
Dewo.

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial