MS Access и BatchUpdate през ADO ?

1 отговора 38 прегледа
#1

MS Access и BatchUpdate през ADO ?

Здравейте.
Някой да се е занимавал с BatchUpdate в MSAccess.
Имам малък проблем.
Когато в рекордсета има повече от един record в които са направени промени Jet машината пищи
IDispatch error # 3156 :Number of rows with pending changes exceeds the limit.


//////////
_variant_t v(m_pProject->m_ptrConnection.GetInterfacePtr());
// Open recordset
m_pRstBugs->CursorType = adOpenKeyset;
m_pRstBugs->LockType = adLockBatchOptimistic;
m_pRstBugs->Open((LPCTSTR)ProjectName, v,
adOpenKeyset,adLockBatchOptimistic,adCmdTableDirect);
// Слага индекс в рекордсета.
if (m_pRstBugs->Supports(adIndex) && m_pRstBugs->Supports(adSeek))
{
// Тук стои името на индекса, а не на индексираната колона !!!!!!!
m_pRstBugs->Index = DBtags::m_sProjectIndexName;
}
// ...


// test only -> Тук се дъни
// при второто минаване през тялото на цикъла казва: Number of rows with pending changes exceeds the limit.
m_pRstBugs->MoveFirst();
while(!m_pRstBugs->adoEOF)
{
_variant_t x("test");
m_pRstBugs->Fields->Item["description"]->Value = x;
m_pRstBugs->MoveNext();
}
m_pRstBugs->UpdateBatch(adAffectAll);
// end test

Почвам да се чудя дали Accessa поддържа batch update

Отговор
в отговор на poceн #2

Re: MS Access и BatchUpdate през ADO ?

Maximum Pending Rows A Long value (read-only) that specifies the maximum number of records that can have pending changes at the same time. This limit does not reflect resource limitations such as RAM, but does apply if the Recordset object implementation uses some strategy that results in a limit. If there is no limit, this value is 0. For the Microsoft Jet provider, the value is always 1.
ot MSDN-a

Отговор