To read the .DBF file work as follows:
I use a TADOConnection, ConnectionString to:
Driver={Microsoft dBASE Driver (*.dbf)};DriverID=277;Dbq=C:\_workspace\projects\DBFEditor\temp
To read the DBF file I use a TADOQuery setting the SQL property for the query:
Select * from <arquivodbf>
So I have these columns in my dbf file.
INDICE NOME COR ESTILO ESCALA
100 SAOJOAO 18 0,00
I need to rename the INDEX column to ID , so I am doing this as follows:
while not ADOQuery1.Eof do
begin
Adoquery1.Edit;
ADOQuery1.FieldByName('NOME').TEXT:= 'ID';
Adoquery1.Post;
ADOQuery1.Next;
end;
But I get the following result when opening my excel:
INDICE NOME COR ESTILO ESCALA
ID SAOJOAO 18 0,00
How do I expect the result:
ID NOME COR ESTILO ESCALA
100 SAOJOAO 18 0,00