Delphi ClientDataset Read Only

I am currently testing:

  • SQLConnection pointing to the IB database.
  • SQLDataset, which has the SQLConnection field set above.
  • DatasetProvider, which has the SQLDataset in (2) as the value of the Dataset field.
  • ClientDataset with the ProviderName field pointing to the provider in (3).

I use the following method (borrowed from Alistair Christie) to get the data ...

function TForm1.GetCurrEmployee(const IEmployeeID: integer): OleVariant; 
const 
  SQLSELEMP = 'SELECT E.* FROM EMPLOYEE E WHERE E.EMPLOYEEID = %s'; 
begin 
  MainDM.SQLDataset1.CommandText := Format(SQLSELEMP, [Edit1.Text]); 
  Result := MainDM.DataSetProvider1.Data; 
end;

Which fills the DBGrid with just one entry. However, when I manually edit the post, click Publish, then try committing the changes using

MainDM.ClientDataset1.ApplyUpdates(0); // <<<<<< 

It is bombing with the message "SQLDataset1: cannot read-only dataset change."

I checked the ReadOnly property of the Provider and ClientDataset, and SQL has no joins.

What can cause an error?

+3
2

, ClientDataSet.Data Data DataSetProvider. ClientDataSet.Open, DataSetProvider.

BTW, DataSetProvider ClientDataSet.ApplyUpdates SQL- , DataSet, ( ). , DataSetProvider.ResolveToDataSet true.

, , , SQL- ( ). WHERE. - Edit1, ( , InterBase ): 1; drop table;

+4

LiveMode TIBDataSet.

0

Source: https://habr.com/ru/post/1704878/


All Articles