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 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80
|
try
{
CTransactionODBC oTransaction;
oSommaire.Vider();
for (unsigned i=0; i<256; i++)
{
if (leStructureDCV->T1_connus[i] != NULL)
{
CBloc_TLV* pBloc = leStructureDCV->T1_connus[i];
pBloc->m_oSommaireLecture.Reinitialiser();
pBloc->m_oSommaireChargement.Reinitialiser();
}
}
// try
// {
if (pDB != NULL)
{
// -- transaction
if (!oTransaction.BeginTrans(pDB))
{
trace(IDS_TRACE_ERR_TRANSACTION_BD);
ASSERT(FALSE); //OK
throw ACCES_BD_IMPOSSIBLE;
}
{
CGenericRecordset oSeqChgt(pDB);
oSeqChgt.Open(CRecordset::forwardOnly, "SELECT seq_chgt_fichier.nextval FROM dual", CRecordset::none);
m_oFichier.m_uiID_chgt = (unsigned)oSeqChgt.m_pParams[0].m_dblVal;
oSeqChgt.Close();
}
{
CGenericRecordset oRecSet(pDB);
oRecSet.m_sNomProprietaire = "ETLADM";
oRecSet.m_sNomTable = "CHGT_FICHIER";
oRecSet.Open(CRecordset::snapshot, NULL, CRecordset::none);
oRecSet.AddNew();
oRecSet.m_pParams[0] = (double)m_oFichier.m_uiID_chgt;
oRecSet.m_pParams[1] = (double)leStructureDCV->GetIdentFormat();
oRecSet.m_pParams[2] = (double)ID_NE;
oRecSet.m_pParams[3] = COleDateTime::GetCurrentTime();
if (CFormatDCV_R2420::oFiltreCourant.m_sNomFiltre.IsEmpty())
oRecSet.m_pParams[4] = m_oFichier.GetFileName();
else
oRecSet.m_pParams[4] = DeterminerNomFichierFiltreCharge(m_oFichier.GetFileName(), CFormatDCV_R2420::oFiltreCourant.m_sNomFiltre);
oRecSet.m_pParams[5] = (double)0;
oRecSet.m_pParams[6] = (double)0;
oRecSet.m_pParams[7] = (double)0;
oRecSet.Update();
}
}
tracePOS(0, IDS_FICHIER_BRUT);
unsigned uiLgLue = 1;
unsigned uiNumBloc = 0;
while (m_oFichier.GetPosition() != m_oFichier.GetLength())
{
uiNumBloc++;
LireCharger(uiNumBloc, ~0);
}
if (pDB != NULL)
{
detruireTousRecordsets(true); // -flush+fermeture des recordsets |
Partager