I want to insert many records into MySQL,so I do as followings:

Qt Code:
  1. ...
  2. QSqlQuery mQuery;
  3. if(!mQuery.exec("LOAD DATA INFILE '"+fileName+"' INTO TABLE table1 FIELDS TERMINATED BY ' ' LINES TERMINATED BY '\r\n'"))
  4. {
  5. QMessageBox::warning(0,"",mQuery.lastError().text());
  6. return false;
  7. }
  8. ...
To copy to clipboard, switch view to plain text mode 

and there is no respones,that is, table1 has no recorders and there is no error.

But when I execute " LOAD DATA INFILE '"+fileName+"' INTO TABLE table1 FIELDS TERMINATED BY ' ' LINES TERMINATED BY '\r\n'" " in cmd window,it is ok,why?