Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

TadoTable and Primary Key with Multi fields : Edatabase Error : Duplication in TIndexDefs

Posted on 2010-08-30
12
Medium Priority
?
1,363 Views
Last Modified: 2012-05-10
Hello,

I have a MSAccess DataBase
And in this DataBase a Table with a Primary Key based on 2 fields (NumField1 and NumField2). This table is in fact linked with 2 mothers tables (one with NumField1 Field and the other with Numfield2 Field)
In delphi i use a TadoConnection  to connect my database (witj odbc driver)
I use too a TadoTable to connect my table and i don't add or specify Index

At compilation no pb.
When i execute my application i have a Edatabase error : my <Primary Key Name > is duplicate in TIndexDefs.

I tried many things and i am sure it's because i have a multi fields in my primary index in access but i don't understand why it's no walk with Tadotable in Delphi.

Thanks for your help

0
Comment
Question by:fprovin
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 5
  • 4
  • 3
12 Comments
 
LVL 14

Expert Comment

by:systan
ID: 33560121
Reset or Reindex or Redefine TIndexDefs

If error persist after that? Remove your primary keys in your Primary Key based Table, but do not remove the primary keys in the 2 mother tables.
0
 
LVL 38

Expert Comment

by:Geert Gruwez
ID: 33560571
are you selecting from 2 tables with identical column names ?

select *
from tableA A, tableB B
where a.numfield1 = b.numfield1

table A:
numfield1
numfield2

table B:
numfield1
numfield2

change query to

select a.numfield1, a.numfield2, b.numfield1 numfield1_b, b.numfield1 numfield2_B
from tableA A, tableB B
where a.numfield1 = b.numfield1


does that work ?
0
 

Author Comment

by:fprovin
ID: 33563371
Hi,

for Geert : no i don't do this. My Tadotable component is based only on one table.
for Systan :
Reset or Reindex : in access ?
Redefine TIndexDefs : ou meen in Delphi ?

Regards
0
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.

 
LVL 14

Expert Comment

by:systan
ID: 33563901
If TIndexDefs is a component,  remove your TIndexDefs, save delphi code, open delphi code, then drop it back again.
0
 
LVL 38

Expert Comment

by:Geert Gruwez
ID: 33564635
can you post a sample .mdb with this behaviour ?

you better add access to the zones, not just delphi
you'll get a lot more access experts to look at this Q
0
 

Author Comment

by:fprovin
ID: 33564711
Hi,

For Systran : in conception i don't have any TindexDefs component i suppose that this component is cretaed  at the execution by TadoTable Component. One fact is sure : i have nothing in my code to create this component.
In Delphi help they said that TindexDef is present in TTable andTClientDataSet  but i am not using these components. (TTable is perhaps used by TadoTable).

For reindex in access, i will do it this morning.

For Geert : ok i post a simple mdb this morning too.
0
 

Author Comment

by:fprovin
ID: 33565768
Hi,

I tried to redefine Index in Access. I still have the same problem.
Here may mdb

Regards
Tests.mdb
0
 
LVL 14

Expert Comment

by:systan
ID: 33566728
Please show your code snippet accessing this database
0
 

Accepted Solution

by:
fprovin earned 0 total points
ID: 33571834
Hi,

I found the solution. If i use a client for curseur location with the tadoconnection i don't have this error. It's a little bit stupid but it means that i am obliged to use the client value for cursor location where i would prefer server but that's like that.

Thanks for all
0
 
LVL 38

Expert Comment

by:Geert Gruwez
ID: 33573649
this actually means that you are using local (memory) resources instead of the ones on the server
it's better like this if you have a lot of clients
0
 
LVL 38

Expert Comment

by:Geert Gruwez
ID: 33573652
posting code would help in finding your problem a lot faster
now it was just blind guessing
0
 

Author Comment

by:fprovin
ID: 33574367
Yeah,
you're right next time i will post the form and unit. At the beginning i was thinking it s not necessary because without code i had the problem. But i forgot parameters of the component

Best Regards
0

Featured Post

[Webinar] Lessons on Recovering from Petya

Skyport is working hard to help customers recover from recent attacks, like the Petya worm. This work has brought to light some important lessons. New malware attacks like this can take down your entire environment. Learn from others mistakes on how to prevent Petya like worms.

Question has a verified solution.

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

Objective: - This article will help user in how to convert their numeric value become words. How to use 1. You can copy this code in your Unit as function 2. than you can perform your function by type this code The Code   (CODE) The Im…
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…
The viewer will learn how to use NetBeans IDE 8.0 for Windows to connect to a MySQL database. Open Services Panel: Create a new connection using New Connection Wizard: Create a test database called eetutorial: Create a new test tabel called ee…
The viewer will learn how to synchronize PHP projects with a remote server in NetBeans IDE 8.0 for Windows.
Suggested Courses

721 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