Problem with MSQuery.OldValue

Discussion of open issues, suggestions and bugs regarding SDAC (SQL Server Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
Posts: 38
Joined: Thu 05 Oct 2006 04:22

Problem with MSQuery.OldValue

Post by Japhar » Mon 26 Feb 2007 14:38


I'm facing below problem in SDAC licenced Version
Please help me

1. I have a one text field, Retrive & Save button on my screen.
One MSConnection, MSQuery, DataSource components
I have attached datasource to TDBtext box.

2. On click of Retrive button i'm just fetching 'empname' from EMP table in Text field. Considering only one entry in EMP table.

Query in MSQuery: Select empname from EMP where empid=1;
Added empname to persistence field. Cached Update property is True.

Retrive button code:

3. Now i changed the value in text box to 'xyz' from 'abc' and clicked on Save button.

My Save button code:

if (MSQuery1.State in [dsEdit,dsInsert]) then //State will be in Edit.


Problem is:
1. After Post statement is executed, the old value is changing to 'xyz'. Which it should not. It should show me as 'abc'.

FYI: Actually we are migrating Informix Data Access Components to SDAC. In Informix it is working fine in the above explained scenario.

Please let me know how to overcome this issue.

Posts: 512
Joined: Thu 26 Jan 2006 10:06

Post by Jackson » Tue 27 Feb 2007 14:20

We have made an example using your description, but we couldn't reproduce the problem.
Please send us (evgeniym*crlab*com) a complete small test project to reproduce the problem; include definition of your own database objects; don't use third party components.
Also supply us the following information:
- Exact version of Delphi or C++ Builder
- Exact version of Microsoft SQL Server and OLE DB provider you use. You can see it the Info sheet of TMSConnection Editor

Post Reply