MS Access & BatchUpdate през ADO ?

1 отговора 72 прегледа
#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

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

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

в хелпа на аксеса какво пише за batch update
..................
всъщност аз взех, че проверих вместо теб....

The following are requirements for creating and using batch transactions in Microsoft Access:

You must be using an Access project connected to a Microsoft SQL Server database (versions 2000, 7.0, and 6.5).
You can only use a data-entry form, and the form must be bound to an updateable record source (inline user-defined function, single statement stored procedure, or SQL SELECT statement). The form can have subforms, but you cannot enclose two independent forms in a single batch transaction.
You set the Batch Updates property of the form to Yes (the default value is No). In a main form/subform combination, this property applies only to the main form. Subforms that are linked to the main form participate in the transaction regardless of the subform's Batch Update property setting. If a subform is not linked to the main form, then it won't participate in the batch transaction.



[линк]

Редактирано от Topбaлaн на

Отговор