<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=iso-8859-1">
<META content="MSHTML 6.00.6000.16809" name=GENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=#ffffff>
<DIV><FONT size=2>I am using Dbase tables and when I create a new table from and
existing one, the real number fields are being created as equivalent to
integers. I was using TDBF from Sourceforge, so I </FONT><FONT
size=2>reverted back to Delphi's own tables and I have exactly the same
problem.</FONT></DIV>
<DIV><FONT size=2></FONT> </DIV>
<DIV><FONT size=2>Using the Database desktop with the newly created file, all
the real numeric fields have field names but incorrectly shown with no
length. <BR> Does Dbase have to have a certain numeric field length to work
? </FONT></DIV>
<DIV>
<P><FONT size=2>Probably not, because making the file manually, as below, should
have then worked. </FONT></P></DIV>
<DIV><FONT size=2>Both options below make no difference.</FONT></DIV>
<DIV><FONT size=2></FONT> </DIV>
<DIV><FONT size=2> tblSave :=
TTable.Create(Application);<BR> with tblSave do
begin<BR>
Active:=False;<BR>
TableType:=ttDBase;<BR> TableName :=
fFiles.eDir.text+'\'+fFiles.eFile.text+'.dbf';<BR>
Name:=fFiles.eFile.text;</FONT></DIV>
<DIV><FONT size=2></FONT> </DIV>
<DIV><FONT size=2>=> <FONT
color=#ff0000>FieldDefs.Assign(dm.tblOper.FieldDefs); // Automatically
assign</FONT> </FONT></DIV>
<DIV><FONT size=2><FONT color=#ff0000></FONT><FONT color=#ff0000></FONT><FONT
color=#ff0000></FONT><FONT color=#ff0000></FONT><FONT color=#ff0000></FONT><FONT
color=#ff0000></FONT><FONT color=#ff0000></FONT><BR><FONT
color=#0000ff>=> with FieldDefs do
begin // Manually
Assign<BR>
Clear;<BR> for i := 0 to
(dm.tblOper.FieldCount -1) do
Begin<BR> if
dm.tblOper.Fields[i].Datatype=ftString
then<BR>
Add(trim(copy(dm.tblOper.Fields[i].Name,8,10)), ftString, 30,
False);<BR> if
dm.tblOper.Fields[i].Datatype=ftSmallint
then<BR>
Add(trim(copy(dm.tblOper.Fields[i].Name,8,10)), ftSmallint, 0,
False);<BR> if
dm.tblOper.Fields[i].Datatype=ftMemo
then<BR>
Add(trim(copy(dm.tblOper.Fields[i].Name,8,10)), ftMemo, 0,
False);<BR> if
dm.tblOper.Fields[i].Datatype=ftFloat
then<BR>
Add(trim(copy(dm.tblOper.Fields[i].Name,8,10)), ftFloat, 0,
False);<BR>
end;</FONT><BR>
end; <BR></FONT></DIV>
<DIV><FONT size=2>Look like the only way I can get a new file with the same
structure is to use a dos copy, open the file and delete all the
records.</FONT></DIV>
<DIV><FONT size=2></FONT> </DIV>
<DIV><FONT size=2>Any other suggestions ?</FONT></DIV>
<DIV><FONT size=2></FONT> </DIV>
<DIV><FONT size=2>Thanks Wallace</FONT></DIV>
<DIV><FONT size=2></FONT> </DIV>
<DIV> </DIV></BODY></HTML>