Icon View Thread

The following is the text of the current message along with any replies.
Messages 1 to 3 of 3 total
Thread List of FieldDefs
Fri, Sep 7 2007 9:04 AMPermanent Link

"Petter Topp"
Hello.

I'm looking for a way to get a list of Fieldname, DataType, Size, Required,
Index for a given table.
The information is going to be used as guidance in connection with
export/import.
Anyone who knows how to achieve this?

Thanks
Petter

Sun, Sep 9 2007 6:31 PMPermanent Link

"Donat Hebert \(Worldsoft\)"
Hi Petter, here's some code which shows how to address various properties
(I use this  to compare to tblSource to see if anything has changed)
This is not the complete list but gives you the idea on how to get the
info..

... your table settings ...
tblSource.Open;
tblSource.FieldDefs.Update;
tblSource.IndexDefs.Update;

... code to what you need... but two portions ... FieldDefs and IndexDefs
for J := 0 to tblSource.FieldDefs.Count - 1 do
begin
  tblTarget.FieldDefs.Items[J].Name
  tblTarget.FieldDefs.Items[J].DataType   ie ftInteger, ftMemo etc..
  tblTarget.FieldDefs.Items[J].DefaultValue
  tblTarget.FieldDefs.Items[J].MaxValue
  tblTarget.FieldDefs.Items[J].MinValue
  tblTarget.FieldDefs.Items[J].Required
  tblTarget.FieldDefs.Items[J].CharCase
  tblTarget.FieldDefs.Items[J].Description
  tblTarget.fields[J].isindexField
  tblTarget.FieldDefs.Items[J].Size
  tblTarget.Encrypted
  tblTarget.Password
end;

for J := 0 to tblSource.IndexDefs.Count - 1 do
begin
 tblTarget.IndexDefs.Items[J].Name
 tblTarget.IndexDefs.Items[J].Fields
 tblTarget.IndexDefs.Items[J].Compression
end;

HTH.  Also see help if you need more .. Donat.


"Petter Topp" <petter.topp@atcdata.no> wrote in message
news:A348D12C-72FB-4CC6-AA97-E5DD275893A8@news.elevatesoft.com...
> Hello.
>
> I'm looking for a way to get a list of Fieldname, DataType, Size,
> Required, Index for a given table.
> The information is going to be used as guidance in connection with
> export/import.
> Anyone who knows how to achieve this?
>
> Thanks
> Petter
>

Mon, Sep 10 2007 3:41 AMPermanent Link

"Petter Topp"
Thank you very much Donat

Petter

"Donat Hebert (Worldsoft)" <donat.hebert@worldsoft.ca> skrev i melding
news:2CF2C63A-16C3-49B7-A116-842372999884@news.elevatesoft.com...
> Hi Petter, here's some code which shows how to address various properties
> (I use this  to compare to tblSource to see if anything has changed)
> This is not the complete list but gives you the idea on how to get the
> info..
>
> .. your table settings ...
> tblSource.Open;
> tblSource.FieldDefs.Update;
> tblSource.IndexDefs.Update;
>
> .. code to what you need... but two portions ... FieldDefs and IndexDefs
> for J := 0 to tblSource.FieldDefs.Count - 1 do
> begin
>   tblTarget.FieldDefs.Items[J].Name
>   tblTarget.FieldDefs.Items[J].DataType   ie ftInteger, ftMemo etc..
>   tblTarget.FieldDefs.Items[J].DefaultValue
>   tblTarget.FieldDefs.Items[J].MaxValue
>   tblTarget.FieldDefs.Items[J].MinValue
>   tblTarget.FieldDefs.Items[J].Required
>   tblTarget.FieldDefs.Items[J].CharCase
>   tblTarget.FieldDefs.Items[J].Description
>   tblTarget.fields[J].isindexField
>   tblTarget.FieldDefs.Items[J].Size
>   tblTarget.Encrypted
>   tblTarget.Password
> end;
>
> for J := 0 to tblSource.IndexDefs.Count - 1 do
> begin
>  tblTarget.IndexDefs.Items[J].Name
>  tblTarget.IndexDefs.Items[J].Fields
>  tblTarget.IndexDefs.Items[J].Compression
> end;
>
> HTH.  Also see help if you need more .. Donat.
>
>
> "Petter Topp" <petter.topp@atcdata.no> wrote in message
> news:A348D12C-72FB-4CC6-AA97-E5DD275893A8@news.elevatesoft.com...
>> Hello.
>>
>> I'm looking for a way to get a list of Fieldname, DataType, Size,
>> Required, Index for a given table.
>> The information is going to be used as guidance in connection with
>> export/import.
>> Anyone who knows how to achieve this?
>>
>> Thanks
>> Petter
>>
>
>

Image