TStringList *MyTextFile = new TStringList ();
MyQuery->First();
for (int i=0; i<MyQuery->RecordCount; i++)
{
/*You have to add the string conaining all the record, you can use delimitiers as ',' or tab characters, ro whatever you want*/
MyTextFile->Append (YourPreparedString);
MyQuery->Next();
}
MyTextFile->SaveToFile ("AnyPath");
delete MyTextFile;