Experts Exchange connects you with the people and services you need so you can get back to work.
procedure ReadTextToDB(FileName: string; TableName: string; DataBaseName: string);
List, Line: TStrings;
List := TStringList.Create;
Line := TStringList.Create;
Qry := TQuery.Create;
Qry.DatabaseName := DatabaseName;
'INSERT INTO ' + TableName + ' (FIELD_1, FIELD_2, FIELD_3, FIELD_4, FIELD_5, FIELD_6) '+
'VALUES (:F1, :F2, :F3, :F4, :F5, :F6);
for I := 0 to List.Count - 1 do
Line.CommaText := List[I];
for J := 0 to 5 do
if J = 0 then
Qry.ParamByName(Format('F%d', [J+1])).AsDateTime := StrToDateTime(Line[J])
Qry.ParamByName(Format('F%d', [J+1])).AsString := Line[J];
Open in new window
Be seen. Boost your question’s priority for more expert views and faster solutions
Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.
Have a better answer? Share it in a comment.
Please enter a first name
Please enter a last name
Must be at least 4 characters long.
Join and Comment
Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.
One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.