Icon View Thread

The following is the text of the current message along with any replies.
Messages 1 to 2 of 2 total
Thread table locale id changed after changing field length
Wed, Feb 10 2010 10:46 AMPermanent Link

=?iso-8859-1?Q?Santy_Concepci=F3n?=
Hi!

I have noticed that, after changing a string field length, table Locale ID
changes to 'ANSI Standar'.
All my tables have 'Spanish - Traditional Sort' language ID, but after
changing a field length it goes back to ANSI Standar.

This is the code I use to change fields length:

{...}
       with AlterTbl do
       begin
           FieldDefs.Update;
           IndexDefs.Update;
           if FieldDefs.Find('field').Size<>50 then
               FieldDefs.Find('field').Size:=50;
           AlterTable;
       end;
{...}

Is there another method to change a field's length which doesn't alter
current table locale id?
If not...
Is it possible to change table's Locale ID by code? Will it affect the data?

Thanks!

--
Santy C.
Wed, Feb 10 2010 11:01 AMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

Santy,

<< This is the code I use to change fields length: >>

Use this instead:


{...}
       with AlterTbl do
       begin
           FieldDefs.Update;
           IndexDefs.Update;
           if FieldDefs.Find('field').Size<>50 then
               FieldDefs.Find('field').Size:=50;
           AlterTable(LocaleID);
       end;
{...}

That will use the existing LocaleID property value for the AlterTable's
LocaleID specification.

--
Tim Young
Elevate Software
www.elevatesoft.com

Image