Data shifted in TMSQuery

Discussion of open issues, suggestions and bugs regarding SDAC (SQL Server Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply

Data shifted in TMSQuery

Post by dougcl » Fri 30 Sep 2005 22:59

Hi, I am still having problems with TMSQuery objects. I occasionally get
AddRefStr failed (D:\Projects\Delphi\Dac\Source\MemData.pas, line 4553)
which I think is thrown when RestoreUpdates is called, and then this is usually followed by
DisposeBuf failed (D:\Projects\Delphi\Dac\Source\MemData.pas, line 4528) when subsequent calls to ApplyUpdates are made. I have no idea what these errors mean. Please tell me why these errors happen! This only happens 1% of the time. Corresponding to this error, is corruption in the dataset, which is then written to the database. In some cases the corruption causes all of the data in the columns to be shifted over by one column. I have no idea how this can happen, and how any combination of published calls on your objects can result in this sort of behavior. Here are some examples of how the data appears in the db, showing the truncation of text, and in some cases, truncation and column shift.

Corrupted and shifted:
NULL,NULL,1,ôl«,truncated text,free text,D,NULL
NULL,NULL,1,Þóø,truncated text,free text,D,NULL
1,NULL,1,þðÓ,truncated text,free text,D,NULL

Just corrupted.
NULL,NULL,1,úPÃtruncated text,free text,D,NULL
NULL,NULL,1,v½truncated text,free text,D,NULL
NULL,NULL,1,61Îtruncated text,NULL,D,NULL
NULL,NULL,1,F’|truncated text,NULL,D,NULL

This is what it's supposed to look like:
NULL,NULL,1,free text,free text,D,NULL

This ALWAYS happens on the same field.

Thanks for any advice you have to offer.

Posts: 1693
Joined: Thu 28 Oct 2004 13:56

Post by Ikar » Mon 03 Oct 2005 06:30

Please supply us following information

- Exact version of Delphi, C++ Builder or Kylix
- Exact version of MyDAC. You can see it in About sheet of TMyConnection Editor
- Exact version of MySQL server and MySQL client.
You can see it in Info sheet of TMyConnection Editor

Try to download MyDAC last version.


Post by dougcl » Thu 13 Oct 2005 19:49

Hello, I believe that I have finally solved the problem. First, the data, while being corrupted, wasn't being shifted. The shift occured in the T-SQL window as a result of the data corruption.

Regarding the data corruption, DisposeBuf errors, and so on (see my other posts here), apparently the problem was due to calling ApplyUpdates on the CloseUp event of a TcxDBComboBox that was connected to the dataset.

The moral appears to be to avoid calling methods on datasets from within event handlers of data aware controls, particularly when the data aware control is using the dataset in question.

Thanks for your assistance,

Post Reply