Solved

Paradox and Primary Keys

Posted on 1999-01-20
2
171 Views
Last Modified: 2010-04-06
How can I get a list of the fields that make up a primary key in a paradox table ?  I would be grateful for any help offered regarding this.
0
Comment
Question by:johnclarke
2 Comments
 
LVL 8

Accepted Solution

by:
ZifNab earned 100 total points
ID: 1362560
Hi JohnClarke,

Download the Free Rx Lib at http://rx.demo.ru/

Use component TTableItems and select dtIndices from property ItemType. Fill in the other needed propertties (table, database, etc). And viola, you got them.

Kind regards, Zif.
0
 
LVL 27

Expert Comment

by:kretzschmar
ID: 1362561
Hi johnclarke


a sample to show indexinformation in a stringgrid

procedure TForm1.Button1Click(Sender: TObject);
var i : Integer;
    s : String;
begin
  table1.IndexDefs.Update;  {retrieve IndexInformation}
  for i := 0 to table1.IndexDefs.Count -1 do
  begin
    //affected Fields
    StringGrid1.Cells[1,i+1] := table1.IndexDefs.Items[i].Fields;
    //Name of the Index
    StringGrid1.Cells[2,i+1] := table1.IndexDefs.Items[i].Name;
    //IsPrimary
    if ixPrimary in table1.IndexDefs.Items[i].Options then
      s := 'PrimaryKey' else s := 'SecondaryKey';
    StringGrid1.Cells[3,i+1] := s;
    //IsUnique
    if ixUnique in table1.IndexDefs.Items[i].Options then
      s := 'Unique' else s := 'NotUnique';
    StringGrid1.Cells[4,i+1] := s;
    //Sortorder
    if ixDescending in table1.IndexDefs.Items[i].Options then
      s := 'DescendingSortorder' else s := 'AscendingSortorder';
    StringGrid1.Cells[5,i+1] := s;
    //IsCaseSensitve
    if ixCaseInsensitive in table1.IndexDefs.Items[i].Options then
      s := 'CaseSensitive' else s := 'NotCaseSensitive';
    StringGrid1.Cells[6,i+1] := s;
  end;
end;

meikl
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

Suggested Solutions

Title # Comments Views Activity
Activex get website that activex running on 3 85
Delphi cmd execution 6 55
Simple Delphi Question 9 83
Delphi : could not find program, '...exe' 2 145
A lot of questions regard threads in Delphi.   One of the more specific questions is how to show progress of the thread.   Updating a progressbar from inside a thread is a mistake. A solution to this would be to send a synchronized message to the…
The uses clause is one of those things that just tends to grow and grow. Most of the time this is in the main form, as it's from this form that all others are called. If you have a big application (including many forms), the uses clause in the in…
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.
Need to grow your business through quality cloud solutions? With everything required to build a cloud platform and solution, you may feel like the distance between you and the cloud is quite long. Help is here. Spend some time learning about the Con…

914 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

12 Experts available now in Live!

Get 1:1 Help Now