Einzelnen Beitrag anzeigen

hoika

Registriert seit: 5. Jul 2006
Ort: Magdeburg
8.270 Beiträge
 
Delphi 10.4 Sydney
 
#6

Re: TADOQuery Primary Key auslesen

  Alt 10. Feb 2010, 12:15
Hallo,

Aus Google.

Zitat:
Using DAO you can look through the TableDef.Indexes collection. There is
an Index.Primary property that is true if the index is a primary key
index. You can then find the field names by looking at the fields
collection of the Index. There may be a more direct way using DAO that I
am not aware of.
Also

Delphi-Quellcode:
ADODataSet1.CommandText := 'SELECT * From Kunde';
        ADODataSet1.Active := True;
        ADODataSet1.IndexDefs.Update;

        for i:= 0 to ADODataSet1.IndexDefs.Count-1 do
        begin
          IndexDef:= ADODataSet1.IndexDefs[i]
          if IndexDef.Primary ...


Heiko
Heiko
  Mit Zitat antworten Zitat