I have one ADOConnection and one TZConnection in my project.
The ADOConnections opens an Excelfile. I want this data to be inserted into my MySQL database.
Here's my code:
Code: Select all
ADOQuery1.Open;
ZQuery1.Open; // MySQL-Tabelle
while not ADOQuery1.Eof do
begin
ZQuery1.Append; // neuer, leerer Datensatz
ZQuery1.FieldByName('content_nr').AsString := ADOQuery1.Fields[0].Value; // Feld kopieren
ZQuery1.FieldByName('content_sprache').AsString := ADOQuery1.Fields[1].Value;
ZQuery1.FieldByName('content_text').AsString := ADOQuery1.Fields[2].Value;
ZQuery1.FieldByName('content_datetime').AsString := 'now()';
ZQuery1.Post; // Daten abschicken
ADOQuery1.Next; // nächste Excel Reihe
end;
Can anybody tell me please, what I am doing wrong.
Thanks,
Christian