Mensaje    Asunto: Importar desde un fichero de texto a una base de datos Responder citando

Si creamos un archivo del tipo:

"Olivier", "Savry", "France"
"Vikash", "Shah", "England"
...

Entonces podrás importarlo así:

code:
TStringList* Records = new TStringList;
TStringList* Fields = new TStringList;
Records->LoadFromFile("myfile.txt");

for(int i = 0; i < Records->Count; ++i)
{
Fields->CommaText = Records->Strings[i];
Table1->Edit();
for(int j = 0; j < Table1->FieldCount;++j)
{
Table1->Fields->Fields[j]->AsString = Fields->Strings[j];
}
Table1->Post();
}

delete Records;
delete Fields;