1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47
|
int NResultats::WriteToDB()
{
int result=0;
COleVariant varInt, varDbl, varL, varC;
varInt.vt = VT_I2;
varDbl.vt = VT_R8;
varL.vt = VT_I4;
varC.vt = VT_I1;
g_mutex.Lock();
g_pRecordset->Open(AFX_DAO_USE_DEFAULT_TYPE,
"SELECT * FROM Images", dbAppendOnly);
if(g_pRecordset->CanAppend())
{
g_pRecordset->AddNew();
g_pRecordset->SetFieldValue("Chemin",LPCTSTR(cheminIm));
g_pRecordset->SetFieldValue( "Date",LPCTSTR(date.Format("%d/%m/%Y %H:%M:%S")) );
varL.lVal=SettingID;
g_pRecordset->SetFieldValue("ReglageID",varL);
varL.lVal=nMoule;
g_pRecordset->SetFieldValue("Moule",varL);
varInt.iVal=bIron;
g_pRecordset->SetFieldValue("bIron",varInt);
// Etc...... yen a une dizaine
g_pRecordset->Update();
}
else
{
result=1;
}
g_pRecordset->Close();
g_mutex.Unlock();
Sleep(0);
return result;
} |
Partager