Board index » delphi » How export the content of a table in file .txt

How export the content of a table in file .txt

Hi all, does exists some function in Delphi that exports the content of a
table in a file in text format? For example the function Table.importfile ('
name arq') of the powerbuilder?

How can I proceed?? I must do a "while"?? I tryed use this statement but it
didn't work..

FileHandle := FileCreate(str_caminho);
While not Qury_se.Eof to
begin
It goes y = 0 to Qury_se.Fields.Count - 1
FileWrite(FileHandle, Qury_se.Fields.Fields[y] .Dislaytext);
end;

I thank any clue,

Thank you.

Victor Hugo.

 

Re:How export the content of a table in file .txt


Hi.

use a TAdoTable and see this method:

procedure SaveToFile(const FileName: String = ''; Format: TPersistFormat =
pfADTG);

Tell me if this help you.

Martin Neu
m...@uol.com.ar

Victor <sein...@netvision.com.br> escribi en el mensaje de noticias
3c062351_2@dnews...

Quote
> Hi all, does exists some function in Delphi that exports the content of a
> table in a file in text format? For example the function Table.importfile
('
> name arq') of the powerbuilder?

> How can I proceed?? I must do a "while"?? I tryed use this statement but
it
> didn't work..

> FileHandle := FileCreate(str_caminho);
> While not Qury_se.Eof to
> begin
> It goes y = 0 to Qury_se.Fields.Count - 1
> FileWrite(FileHandle, Qury_se.Fields.Fields[y] .Dislaytext);
> end;

> I thank any clue,

> Thank you.

> Victor Hugo.

Re:How export the content of a table in file .txt


One way is to use the BDE ASCII driver. See ASCIIDRV in the BDE API help
file in your BDE directory. It can create either comma delimited or fixed
length text files.

--
Bill
(TeamB cannot answer questions received via email)

Other Threads