 |
BorlandTalk.com Borland discussion newsgroups
|
| View previous topic :: View next topic |
| Author |
Message |
Anja Guest
|
Posted: Tue Nov 25, 2003 8:16 am Post subject: Primary Key in TTable descendant |
|
|
Hi folks,
I'm trying to create a descendant of TTable with the ability to return
the value of the current primary key.
So I wanted to create a component TasTable with read-only property
PrimaryKey, which then I could use in a statement like
MyTable.SetRange( Mytable.PrimaryKey, Mytable.PrimaryKey)
to filter the range to only the current record.
My problem : which type does my property has to have?
So: property PrimaryKey : ????
read GetPrimaryKey ;
Be aware that a Primary key can be composed of several values of
different types.
Thanks for your replys.
Anja.
|
|
| Back to top |
|
 |
John McCarten Guest
|
Posted: Sat Dec 06, 2003 1:21 pm Post subject: Re: Primary Key in TTable descendant |
|
|
"Anja" wrote
| Quote: | ... I wanted to create a component TasTable with read-only property
PrimaryKey, which then I could use in a statement like
MyTable.SetRange( Mytable.PrimaryKey, Mytable.PrimaryKey)
to filter the range to only the current record.
My problem : which type does my property has to have?
So: property PrimaryKey : ????
read GetPrimaryKey ;
|
property PrimaryKey: TasPrimaryKey read GetPrimaryKey;
How you construct TasPrimaryKey depends on what data base/stream/source is
behind TasTable.
j.
|
|
| Back to top |
|
 |
Anja Guest
|
Posted: Mon Dec 08, 2003 9:17 am Post subject: Re: Primary Key in TTable descendant |
|
|
"John McCarten" <johnmccarten[ns]@ihug.co.nz> wrote:
| Quote: | "Anja" wrote
... I wanted to create a component TasTable with read-only property
PrimaryKey, which then I could use in a statement like
MyTable.SetRange( Mytable.PrimaryKey, Mytable.PrimaryKey)
to filter the range to only the current record.
My problem : which type does my property has to have?
So: property PrimaryKey : ????
read GetPrimaryKey ;
property PrimaryKey: TasPrimaryKey read GetPrimaryKey;
How you construct TasPrimaryKey depends on what data base/stream/source is
behind TasTable.
j.
All my tables are Paradox tables, and a primary key can be composed of any combination of strings or integers. I don't use currency fields or blob's in a primary key. |
|
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|