Icon View Thread

The following is the text of the current message along with any replies.
Messages 1 to 4 of 4 total
Thread Table Restructuring
Thu, Feb 23 2006 4:57 PMPermanent Link

"Jonas Wik"
We are having a problem when we try and restructure our tables.  If you add
or remove a field the information in that field does not move, the field
just changes. So if Field[1] is a String and when we restructure the table
Field[1] is an Integer we get an error that the string is not a valid
integer.  I was wondering if there is something i can do that when we
restructure the field we can move the whole field to that position or does
the restructure just change the field type.

Fri, Feb 24 2006 1:34 PMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

Jonas,

<< We are having a problem when we try and restructure our tables.  If you
add or remove a field the information in that field does not move, the field
just changes. So if Field[1] is a String and when we restructure the table
Field[1] is an Integer we get an error that the string is not a valid
integer.  I was wondering if there is something i can do that when we
restructure the field we can move the whole field to that position or does
the restructure just change the field type.  >>

If you could post the code that you're using, I could give you some more
pointers on how to get it to do what you want.

--
Tim Young
Elevate Software
www.elevatesoft.com

Fri, Feb 24 2006 5:49 PMPermanent Link

"Jonas Wik"
the code is,

FieldDefs.Clear
for ndx := 0 to FieldCount - 1 do begin
 tblDef := TObject( TheDefs.Objects[ndx] ) as tSamFieldDef;
 Add(TblDef.FieldName, TblDef.FieldType, TblDef.FieldLength,
TblDef.Required);
end;

"Tim Young [Elevate Software]" <timyoung@elevatesoft.com> wrote in message
news:A0F188F8-B6B7-4868-9A27-8F675EE2AB33@news.elevatesoft.com...
> Jonas,
>
> << We are having a problem when we try and restructure our tables.  If you
> add or remove a field the information in that field does not move, the
> field just changes. So if Field[1] is a String and when we restructure the
> table Field[1] is an Integer we get an error that the string is not a
> valid integer.  I was wondering if there is something i can do that when
> we restructure the field we can move the whole field to that position or
> does the restructure just change the field type.  >>
>
> If you could post the code that you're using, I could give you some more
> pointers on how to get it to do what you want.
>
> --
> Tim Young
> Elevate Software
> www.elevatesoft.com
>
>

Mon, Feb 27 2006 6:55 AMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

Jonas,

<< the code is,

FieldDefs.Clear
for ndx := 0 to FieldCount - 1 do begin
 tblDef := TObject( TheDefs.Objects[ndx] ) as tSamFieldDef;
 Add(TblDef.FieldName, TblDef.FieldType, TblDef.FieldLength,
TblDef.Required);
end; >>

Okay, if you're maintaining the structure in your own objects and you want
to maintain the proper relationship back to the original field definitions,
even if they are moved, then you need to also store and specify the FieldNo
for each field.  Are you using DBISAM 3.x or 4.x ?

--
Tim Young
Elevate Software
www.elevatesoft.com

Image