FastJavelin
Member
My problem is basically as follows:
I have a Delphi form with 2 DBEdit fields;
I will refer to them here by DBEditX and DBEditY.
The fields are bound to a dataset with this SQL statement:
SELECT T1.RowID, T1.X AS X, NVL(T2.Y, T1.Y) AS Y
FROM T1, T2
WHERE T1.FK = T2.PK (+)
(1)
If T1.FK is NULL then T2.Y is NULL
and the controls show information from T1 only.
(2)
If T1.FK is not NULL then T2.Y is not NULL
and DBEditY shows a value from T2.
What I want to do is this:
Case (1):
Editing the value in DbEditY should update T1.Y;
this works fine.
Case (2):
Editing the value in DbEditY is not allowed so DbEditY is disabled.
However: when I edit DbEditX, I get an error message "record has been modified by another user."
This error occurs on each attempt to put the dataset in Edit mode.
I had expected this to work since I set the dataset's UpdatingTable = T1.
I cannot make Y a calculated field as this would not allow me to update it in case (1).
Is there an elegant way to solve this?
Kind regards,
Geert.
I have a Delphi form with 2 DBEdit fields;
I will refer to them here by DBEditX and DBEditY.
The fields are bound to a dataset with this SQL statement:
SELECT T1.RowID, T1.X AS X, NVL(T2.Y, T1.Y) AS Y
FROM T1, T2
WHERE T1.FK = T2.PK (+)
(1)
If T1.FK is NULL then T2.Y is NULL
and the controls show information from T1 only.
(2)
If T1.FK is not NULL then T2.Y is not NULL
and DBEditY shows a value from T2.
What I want to do is this:
Case (1):
Editing the value in DbEditY should update T1.Y;
this works fine.
Case (2):
Editing the value in DbEditY is not allowed so DbEditY is disabled.
However: when I edit DbEditX, I get an error message "record has been modified by another user."
This error occurs on each attempt to put the dataset in Edit mode.
I had expected this to work since I set the dataset's UpdatingTable = T1.
I cannot make Y a calculated field as this would not allow me to update it in case (1).
Is there an elegant way to solve this?
Kind regards,
Geert.