我用TQuery组件打开DBF文件,想遍历文件的字段时只要是大于10字节的字段名就会被自动截断为10字节。如字段名为<这是字段名11> 就会显示为<这是字段名>,我也不能换别的组件啦。各位帮帮忙解决!!!很急!!!
Query1.Close;
Query1.SQL.Clear;
Query1.SQL.Add('select * from C:\temp.dbf');
Query1.Open;
with Query1 do
begin
for i:=0 to FieldCount-1 do
begin
ShowMessage(Fields[i].FieldName);
end;
end;
Query1.Close;
Query1.SQL.Clear;
Query1.SQL.Add('select * from C:\temp.dbf');
Query1.Open;
with Query1 do
begin
for i:=0 to FieldCount-1 do
begin
ShowMessage(Fields[i].FieldName);
end;
end;
i : Integer;
begin
for i := RepDBGrid.Columns.Count - 1 do
begin
if Length(RepDBGrid.Columns[i].DisplayText) > 10 then
RepDBGrid.Columns[i].DisplayText := LeftStr(RepDBGrid.Columns[i].DisplayText,10);
end;
if Length(RepDBGrid.Columns[i].DisplayText) > 5 then
RepDBGrid.Columns[i].DisplayText := LeftStr(RepDBGrid.Columns[i].DisplayText,5);