Mega Search
23.2 Million


Sign Up

Make a donation  
About TFDQuery as TClienteDataSet  
News Group: embarcadero.public.delphi.database.firedac

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

Vote for best question.
Score: 0  # Vote:  0
Date Posted: 15-Jan-2015, at 12:33 PM EST
From: Pablo Romero Romero
 
Re: About TFDQuery as TClienteDataSet  
News Group: embarcadero.public.delphi.database.firedac
Probably you need to set FDQuery.CachedUpdates to True.

-- 
With best regards,
Dmitry Arefiev / FireDAC Architect

Vote for best answer.
Score: 0  # Vote:  0
Date Posted: 15-Jan-2015, at 10:50 PM EST
From: Dmitry Arefiev