Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Lost data in ClientDataSet!!??

Status
Not open for further replies.

hstijnen

Programmer
Nov 13, 2002
172
NL
Hi,

I'm using ClientDataSets
The stucture is mainly: DataSource --> CDSet --> DSProvider --> TQuery
Now I have a very strange (and bad) effect, as follows.
In my TQuery there is a.o. a TMemo field (Blob field in Interbase). When I modify the memo field (TDBMemo) all is OK.
However, when I modify a field other than the TMemo, then, after ApplyUpdates(), all data in the TMemo field are lost!!
(At first it is not visible, for the data in the TDBMemo are OK, but when I retrieve the record anew, the TDBMemo is void).

Please, can anyone help me? Perhaps it has to do with the parameter options in the DSProvider.

Thanks in advance,

Henk Stijnen.
 
I'v now more isolated the problem:
In the DSProvider's BeforeUpdateRecord event:
a. when memofield NOT modified:
DeltaDS->FieldByName("memo")->NewValue.IsEmpty() is true.
b. when memofield is cleared by the user:
DeltaDS->FieldByName("memo")->NewValue.IsNull() is true.

Apparently CBuilder interprets case a equal case b!! And you are loosing your data!

Now I can walk around the problem by defining different UpdateSQL components for memo fields and managing them from BeforeUpdateRecord. However in my opinion it is not very beautiful. It should be done by setting the just properties, or it is a bug in CBuilder.

Henk

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top