Board index » delphi » Multi-table queries not readonly?

Multi-table queries not readonly?

Using D5 and Paradox database
I'm struggling with Multi-table queries and try to update some of the fields
in one of the underlaying table.
Is there any examples anywhere I can use.
I have used UpdateSQL but I always run in to the error message "Table is
ReadOnly" when I try to update the query.

/Ronny

 

Re:Multi-table queries not readonly?


You must use the UpdateSQL and the query's cachedUpdates property must be set to
true. Search online help for cached updates in order to have a complete
information of what you must do.
bye

Quote
Ronny Bengtsson wrote:
> Using D5 and Paradox database
> I'm struggling with Multi-table queries and try to update some of the fields
> in one of the underlaying table.
> Is there any examples anywhere I can use.
> I have used UpdateSQL but I always run in to the error message "Table is
> ReadOnly" when I try to update the query.

> /Ronny

--
Guillermo Casta?o Acevedo
Gerente de Sistemas - Grupo Millennium Ltda
Guiller...@GrupoMillennium.com
www.GrupoMillennium.com

Re:Multi-table queries not readonly?


Guillermo,

I'm using the UpdateSQL and the SQL Cached Updates but the "Table is Read
Only" error is still there.
I have attached the code below if you can find anything.

procedure TFormBatchDialog.BitBtnApplyClick(Sender: TObject);
begin
  with Query1 do
  begin
    try
      ApplyUpdates; {try to write the updates to the database};
   except
    raise; {raise the exception to prevent a call to CommitUpdates!}
    end;
  CommitUpdates; {on success, clear the cache}
  end;
end;

procedure TFormBatchDialog.Query1UpdateRecord(DataSet: TDataSet;
  UpdateKind: TUpdateKind; var UpdateAction: TUpdateAction);
begin
  try
    FormBatchDialog.UpdateSQL1.Apply(UpdateKind);
    UpdateAction := uaApplied;
  except
    UpdateAction := uaFail;
  end;
end;

/Ronny

"Guillermo Casta?o A" <Guiller...@GrupoMillennium.com> skrev i meddelandet
news:3C37A342.77BE2C7D@GrupoMillennium.com...

Quote
> You must use the UpdateSQL and the query's cachedUpdates property must be
set to
> true. Search online help for cached updates in order to have a complete
> information of what you must do.
> bye

> Ronny Bengtsson wrote:

> > Using D5 and Paradox database
> > I'm struggling with Multi-table queries and try to update some of the
fields
> > in one of the underlaying table.
> > Is there any examples anywhere I can use.
> > I have used UpdateSQL but I always run in to the error message "Table is
> > ReadOnly" when I try to update the query.

> > /Ronny

> --
> Guillermo Casta?o Acevedo
> Gerente de Sistemas - Grupo Millennium Ltda
> Guiller...@GrupoMillennium.com
> www.GrupoMillennium.com

Re:Multi-table queries not readonly?


I don't known is Paradox required it but in yours multi-table query, did you
select all the field of the primary key from the table you wish to update ?

Greg

Other Threads