Page 1 of 1

Problem with MSQuery.OldValue

Posted: Mon 26 Feb 2007 14:38
by Japhar
Hi,

I'm facing below problem in SDAC licenced Version 3.80.0.32.
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:
MSQuery1.Close;
MSQuery1.Open;

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.
begin
MSQuery1.Post;
end;

showmessage(MSQuery1.FieldByName('empname').OldValue);


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.

Posted: Tue 27 Feb 2007 14:20
by Jackson
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