Board index » delphi » Cached Update - Read Only error

Cached Update - Read Only error

I am trying to get a table working with Cached Updates.

I am inserting 3 rows in the grid and then attempting to ApplyUpdates.
The first insert actually makes it to the database, but then I get a
"Table is read-only" error.

I can't find anywhere where I've set the tables to read only.
Does anybody know why this happens?

Terry Pascal

 

Re:Cached Update - Read Only error


Quote

>I can't find anywhere where I've set the tables to read only.
>Does anybody know why this happens?

are you doing anything in the OnUpdateRecord event?  I have a note indicating
the error you are getting can be caused by incorectly implementing
OnUpdaterecord.

--
Brian Bushay (TeamB)
Bbus...@DataGuidance.com

Re:Cached Update - Read Only error


Don't use cached updates, you can use transactions without cached updates.
Cached updates are VERY BUGGY!!!!!!!!!.  That error was reported to borland
long ago, and now one every replied to the newsgroup or to myself that it
was fixed.  Maybe in D4.

Quote
Terry Pascal wrote in message <358BD5E4.7...@globalserve.net>...
>I am trying to get a table working with Cached Updates.

>I am inserting 3 rows in the grid and then attempting to ApplyUpdates.
>The first insert actually makes it to the database, but then I get a
>"Table is read-only" error.

>I can't find anywhere where I've set the tables to read only.
>Does anybody know why this happens?

>Terry Pascal

Re:Cached Update - Read Only error


Here is all the code I currently have in the OnUpdateRecord event:

        // Check UpdateKind property
        Case UpdateKind of
                ukInsert:
                begin
                        OrderDetailsUSQL.SetParams( ukInsert );
                        OrderDetailsUSQL.ExecSQL( ukInsert );
                end;
                ukModify: ;
                ukDelete: ;
        end;

I haven't tried anything else cause I can't get by the read only error.
Also, it appears to be after the first record successfully inserts.

Terry Pascal
stealthgr...@globalserve.net

Quote
Brian Bushay TeamB wrote:

> >I can't find anywhere where I've set the tables to read only.
> >Does anybody know why this happens?

> are you doing anything in the OnUpdateRecord event?  I have a note indicating
> the error you are getting can be caused by incorectly implementing
> OnUpdaterecord.

> --
> Brian Bushay (TeamB)
> Bbus...@DataGuidance.com

Re:Cached Update - Read Only error


Quote
>Here is all the code I currently have in the OnUpdateRecord event:

I suggest you set updateAction to something other than DaFail

from Delphi help.
...............
The UpdateAction parameter indicates if you applied an update or not. The
default value is uaFail. Unless you encounter a problem during updating, your
event handler should set this value to uaApplied before exiting. If you decide
not to update a particular record, set the value to uaSkip to preserve unapplied
changes in the cache.

If you do not change the value for UpdateAction, the entire update operation for
the dataset is aborted. For more information about UpdateAction, see "Specifying
the action to take."

--
Brian Bushay (TeamB)
Bbus...@DataGuidance.com

Re:Cached Update - Read Only error


Thanks Brian, worked great!
Obviously I missed the documentation on that!?!

Terry Pascal
stealthgr...@globalserve.net

Quote
Brian Bushay TeamB wrote:

> >Here is all the code I currently have in the OnUpdateRecord event:

> I suggest you set updateAction to something other than DaFail

> from Delphi help.
> ...............
> The UpdateAction parameter indicates if you applied an update or not. The
> default value is uaFail. Unless you encounter a problem during updating, your
> event handler should set this value to uaApplied before exiting. If you decide
> not to update a particular record, set the value to uaSkip to preserve unapplied
> changes in the cache.

> If you do not change the value for UpdateAction, the entire update operation for
> the dataset is aborted. For more information about UpdateAction, see "Specifying
> the action to take."

> --
> Brian Bushay (TeamB)
> Bbus...@DataGuidance.com

Other Threads