[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

Paradox and Primary Keys

Posted on 1999-01-20
2
Medium Priority
?
181 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 400 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

[Webinar] Cloud and Mobile-First Strategy

Maybe you’ve fully adopted the cloud since the beginning. Or maybe you started with on-prem resources but are pursuing a “cloud and mobile first” strategy. Getting to that end state has its challenges. Discover how to build out a 100% cloud and mobile IT strategy in this webinar.

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…
Loops Section Overview
Despite its rising prevalence in the business world, "the cloud" is still misunderstood. Some companies still believe common misconceptions about lack of security in cloud solutions and many misuses of cloud storage options still occur every day. …
Suggested Courses

872 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