mourad
1st June 2009, 09:25
Hello everyone, I've a function which save my firebird db.
if(!QFile::exists(QString("%1/Db/TSF_CARNET_REVEILS.FDB").arg(qApp->applicationDirPath())))
{
QMessageBox::critical(this,AppName,"Fichier de base de données introuvable.");
return;
}
QProcess proc_copy_db;
QString cmd_proc = QString("copy \"%1\\Db\\TSF_CARNET_REVEILS.FDB\" \"%1\\Db\SaveDb\"").arg(qApp->applicationDirPath().replace("/", "\\"), QDate::currentDate().toString("dd_MM_yyyy"));
proc_copy_db.start(cmd_proc);
if (!proc_copy_db.waitForStarted())
return ;
proc_copy_db.closeWriteChannel();
if (!proc_copy_db.waitForFinished())
return;
The problem is that the process exit from waitForStarted. I've tried to obtain the exitCode and Error but always I've 0 and Unknow Error.
Can anyone tell me where I'm wrong and what to do to resolve this problem.
This function is lunched by button clik.
Many thanks in advance.
Best regards.
if(!QFile::exists(QString("%1/Db/TSF_CARNET_REVEILS.FDB").arg(qApp->applicationDirPath())))
{
QMessageBox::critical(this,AppName,"Fichier de base de données introuvable.");
return;
}
QProcess proc_copy_db;
QString cmd_proc = QString("copy \"%1\\Db\\TSF_CARNET_REVEILS.FDB\" \"%1\\Db\SaveDb\"").arg(qApp->applicationDirPath().replace("/", "\\"), QDate::currentDate().toString("dd_MM_yyyy"));
proc_copy_db.start(cmd_proc);
if (!proc_copy_db.waitForStarted())
return ;
proc_copy_db.closeWriteChannel();
if (!proc_copy_db.waitForFinished())
return;
The problem is that the process exit from waitForStarted. I've tried to obtain the exitCode and Error but always I've 0 and Unknow Error.
Can anyone tell me where I'm wrong and what to do to resolve this problem.
This function is lunched by button clik.
Many thanks in advance.
Best regards.