Solved

Paradox and Primary Keys

Posted on 1999-01-20
2
168 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
Comment Utility
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
Comment Utility
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

How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

Join & Write a Comment

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 The parallel port is a very commonly known port, it was widely used to connect a printer to the PC, if you look at the back of your computer, for those who don't have newer computers, there will be a port with 25 pins and a small print…
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

743 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

15 Experts available now in Live!

Get 1:1 Help Now