Solved

Paradox and Primary Keys

Posted on 1999-01-20
2
175 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
[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
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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
When I am typing into a TEdit last word repeats 7 162
select query - oracle 16 101
Multiple image collision 13 89
SQL Server Express automatically execute SQL or SP 8 37
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…
In this tutorial I will show you how to use the Windows Speech API in Delphi. I will only cover basic functions such as text to speech and controlling the speed of the speech. SAPI Installation First you need to install the SAPI type library, th…

726 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