Subject R: [IBO] TIBO* V.4.2Ga - CacheDMLRefresh after InternalDataset buffer syncronization
Author Enrico Raviglione
I work in C++Builder and i have inherited 2 new component from TIBOTable and
TIBOQuery for add some new features (one is DMLCache) and publish some
internal properties (DMLCacheFlags).
The attached code are part of your IBA_BDataset.IMP translated to C++ and
used in my inherited component.

Regards,
Enrico Raviglione.


-----Messaggio originale-----
Da: Jason Wharton [mailto:jwharton@...]
Inviato: giovedi 7 marzo 2002 21.12
A: IBObjects@yahoogroups.com
Oggetto: Re: [IBO] TIBO* V.4.2Ga - CacheDMLRefresh after InternalDataset
buffer syncronization


This doesn't make any sense to me.
Why is there IBO code written in C?

Jason Wharton
CPS - Mesa AZ
http://www.ibobjects.com


----- Original Message -----
From: "Enrico Raviglione" <e.raviglione@...>
To: <IBObjects@yahoogroups.com>
Sent: Monday, March 04, 2002 11:21 AM
Subject: R: [IBO] TIBO* V.4.2Ga - CacheDMLRefresh after InternalDataset
buffer syncronization


> Hi Jason,
> i have installed your 4.2Ga and i have try your Resync([]) solution.
> For "ditInsert" and "ditDelete" case all seem to work fine but "ditEdit"
> case have some refresh problem.
>
> I attach here my C++ code, how you can see in "ditEdit" case i do only an
> InvalidateBookmark() but when i do this my current record are changed and
> the Grid display another section of the table (??).
>
> void __fastcall TIsIBOTable::DefaultDMLCacheReceivedItem(TIB_Dataset
> *ADataset, const TIB_DMLCacheItem *ADMLCacheItem)
> {
> //
> // From: IBA_BDataset.IMP -->
> TIB_BDataset.DefaultDMLCacheReceivedItem()
> //
>
> TIBOInternalDataset * IDataset = dynamic_cast<TIBOInternalDataset
> *>(ADataset);
>
> if ( IDataset )
> {
> int ii;
> String tmpStr;
>
> tmpStr = "";
> for (ii = 0; ii <= IDataset->KeyFields->ColumnCount - 1; ii++ )
> {
> if ( ii > 0 )
> tmpStr = tmpStr + ";";
>
> tmpStr = tmpStr + IDataset->KeyFields->Columns[ii]->FieldName;
> }
>
> if ( AnsiCompareText(ADMLCacheItem->KeyFieldNames, tmpStr) == 0 )
> {
> IDataset->KeyFields->Values[ ADMLCacheItem->KeyFieldNames ] =
> ADMLCacheItem->KeyFieldValues;
>
> if ( State == dsEdit || State == dsInsert )
> FFlagDMLRefreshPending = true;
>
> if ( State == dsBrowse )
> {
> FFlagDMLRefreshPending = false;
>
> TResyncMode syncMode;
> syncMode.Clear();
>
> switch ( ADMLCacheItem->DMLCacheItemType )
> {
> case ditEdit:
> InvalidateBookmark(IDataset->KeyFields->RowData);
> break;
>
> case ditDelete:
> {
>
> IDataset->DeleteBufferBookmark(IDataset->KeyFields->RowData );
> UpdateCursorPos();
> Resync( syncMode );
> }
> break;
>
> case ditInsert:
> {
> IDataset->InsertBufferBookmark(
> IDataset->KeyFields->RowData );
> UpdateCursorPos();
> Resync( syncMode );
> }
> break;
> }
> }
> }
> }
> }
>
file://---------------------------------------------------------------------
-----
> -
>
> Best Regards,
> Enrico Raviglione.





___________________________________________________________________________
IB Objects - direct, complete, custom connectivity to Firebird or InterBase
without the need for BDE, ODBC or any other layer.
___________________________________________________________________________
http://www.ibobjects.com - your IBO community resource for Tech Info papers,
keyword-searchable FAQ, community code contributions and more !

Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/