Solved

Paradox and Primary Keys

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

Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

Question has a verified solution.

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

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…
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…
This tutorial gives a high-level tour of the interface of Marketo (a marketing automation tool to help businesses track and engage prospective customers and drive them to purchase). You will see the main areas including Marketing Activities, Design …
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

776 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