About TFDQuery as TClienteDataSet

Hi Fellas:

I have a question about TFDQuery.

I have an SQL like this

"Select MyColumn, MyAnotherColumn, 0 as MyBooleanColumn...from MyTable"

Note "0 as MyBooleanColumn" expression.

That column is in a TDbGrid, with a checkbox.

When the user navigates the row and select the record -using the Space 
bar in the grid- the checkbox is checked, using this

  MyQuery.Edit;
  if fxSomeConditionPayments Then
     MyQuery.FieldByname('MyBooleanColumn').AsInteger := 1
  else
     MyQuery.FieldByname('MyBooleanColumn').AsInteger := 0
  MyQuery.Post;

The grid shows the checkbox according the condition. But I get the error 
"Column not found" at "MyQuery.Post"

If the TFDQuery is a TClientDataset all this works ok.

Is there a way to use the TFDQuery as a TClientDataset -without using a 
TClientDataSet-? Some property that means "give me the records and I 
will have the records locally to manipulate them as I wish...

Regards

Pablo Romero
Cordoba, Argentina
0
Pablo
1/15/2015 8:33:52 PM
embarcadero.delphi.firedac 822 articles. 2 followers. Follow

1 Replies
3041 Views

Similar Articles

[PageSpeed] 54

Probably you need to set FDQuery.CachedUpdates to True.

-- 
With best regards,
Dmitry Arefiev / FireDAC Architect
0
Dmitry
1/16/2015 6:50:55 AM
Reply: