Trouble with Key.Columns.Count in Delphi 5
From: Eugene V. Goldberg (egold_at_mts-nn.ru)
Date: 12/23/03
- Next message: Daniel Lemire: "ADO in dll AV"
- Previous message: Austin: "Re: Need Advice - Access XP and ADO"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Tue, 23 Dec 2003 23:01:53 +0300
Yes, i installed the ADOUpdatePack.
My code looks like the following:
ConnectionString := 'Provider=SQLOLEDB.1;Password=dba;Persist Security
Info=True;User ID=sql;Initial Catalog=System;Data Source=CORE';
FCatalog := CoCatalog.Create;
FCataLog._Set_ActiveConnection(ConnectionString);
Table := CoTable.Create;
for i := 0 to FCatalog.Tables.Count - 1 do
if CompareText('Companies', FCataLog.Tables[i].Name) = 0 then
begin
Table := FCatalog.Tables[i];
Break
end;
for i := 0 to Table.Keys.Count - 1 do
begin
Key := Table.Keys[i];
if Key.Type_ = adKeyPrimary then
begin
FieldName := '';
for j := 0 to Key.Columns.Count - 1 do <<<<<<------------here is the
error
begin
if FieldName <> '' then
FieldName := FieldName + ';';
FieldName := FieldName + Key.Columns[j].Name;
end;
ShowMessage(FieldName);
end
end;
Table := nil
Anybody knows why i cant use Key.Columns.Count? It just gives me error that
i cant use this property...
I know that table "Companies" has one primary key and i need to retrieve
columns
this key consists of...
Thanx,
Eugene.
- Next message: Daniel Lemire: "ADO in dll AV"
- Previous message: Austin: "Re: Need Advice - Access XP and ADO"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|