Solved

Paradox indexes

Posted on 1998-05-13
5
342 Views
Last Modified: 2012-05-04
I have a problem with Paradox indexes. I must delete all without copy table , then recreate it. I know that I can delete secondary indexes , but how I can delete primary index. I have a key field in AutoInc field , when I copy records to new table this fields has different value from first because I sometimes delete records :}
OK:} I want know how I can delete primary index in my program :}:}:} See ya :}
0
Comment
Question by:Waldek
  • 3
  • 2
5 Comments
 
LVL 5

Expert Comment

by:JimBob091197
ID: 1345297
I seem to remember that if you recreate the index it overwrites the existing index.  I may be wrong, but have you tried it?

JB
0
 
LVL 2

Author Comment

by:Waldek
ID: 1345298
In fact its true , but I had a problem again, not till then , when I delete all indexes with database desktop problem disappear
When I use dbiRegenIndexes problem remain :}
Problem is : when user insert a new record to database (paradox , net Microsoft Network) a new record doesn't save in table , but no message , no exception) when I delete all indexes and recreate it with DBD problem disappear :} I want know how make this with code , because I don't want , that end user must uses DBD :}
0
 
LVL 5

Expert Comment

by:JimBob091197
ID: 1345299
The help file says you can't use TTable.DeleteIndex to delete a primary index, but in fact you can.  I have just tested the following, and it works:

  tblTest := TTable.Create(Self);
  try
    tblTest.DatabaseName := 'C:\Temp\Temp';
    tblTest.TableName := 'Test';
    tblTest.DeleteIndex('');
    tblTest.AddIndex('', 'AutoField', [ixPrimary]);
  finally
    tblTest.Free;
  end;


Cheers,
JB
0
 
LVL 2

Author Comment

by:Waldek
ID: 1345300
Ok . Fact :};]
Write answer :} if You want points :}
0
 
LVL 5

Accepted Solution

by:
JimBob091197 earned 100 total points
ID: 1345301
Hi Waldek

If you have tested DeleteIndex for primary indeces, then you can grade this answer.

Cheers,
JB
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

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…
Creating an auto free TStringList The TStringList is a basic and frequently used object in Delphi. On many occasions, you may want to create a temporary list, process some items in the list and be done with the list. In such cases, you have to…
This Micro Tutorial will give you a basic overview how to record your screen with Microsoft Expression Encoder. This program is still free and open for the public to download. This will be demonstrated using Microsoft Expression Encoder 4.
Many functions in Excel can make decisions. The most simple of these is the IF function: it returns a value depending on whether a condition you describe is true or false. Once you get the hang of using the IF function, you will find it easier to us…

920 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

17 Experts available now in Live!

Get 1:1 Help Now