Problem with MSQuery.OldValue
Posted: Mon 26 Feb 2007 14:38
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.
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.