Subject | RE: [IBO] FieldReadonly |
---|---|
Author | Paul Vinkenoog |
Post date | 2003-05-21T02:14:13Z |
Hi Alan,
Nice to follow your little solo conversation ;-)
...that the update SQL is not a problem as long as you protect the
column against updating at the IBO level (the update SQL will then
just set the existing value for the field in question).
...that trying to set ReadOnly via the TIB_Column (which you get from
FieldByName) is not the right way. I even suspect that TIB_Column's
ReadOnly property is a read-only property ;-)
...that you should do this through the FieldsReadOnly property of
the dataset, like this:
with MyQuery.FieldsReadOnly do
begin
if BlokeIsAdmin
then LinkValues[ 'MyTable.ThisColumn' ] = 'F';
else LinkValues[ 'MyTable.ThisColumn' ] = 'T';
end;
You might need to (un- and/or) reprepare if you do this.
Good luck,
Paul Vinkenoog
Nice to follow your little solo conversation ;-)
> ok, can I assume then, that since I have custon update SQL for myI don't have IBO or the IBO Help handy but I think...
> query and a column is included in the update, that the setting of
> readonly for that column is ignored?
...that the update SQL is not a problem as long as you protect the
column against updating at the IBO level (the update SQL will then
just set the existing value for the field in question).
...that trying to set ReadOnly via the TIB_Column (which you get from
FieldByName) is not the right way. I even suspect that TIB_Column's
ReadOnly property is a read-only property ;-)
...that you should do this through the FieldsReadOnly property of
the dataset, like this:
with MyQuery.FieldsReadOnly do
begin
if BlokeIsAdmin
then LinkValues[ 'MyTable.ThisColumn' ] = 'F';
else LinkValues[ 'MyTable.ThisColumn' ] = 'T';
end;
You might need to (un- and/or) reprepare if you do this.
Good luck,
Paul Vinkenoog