I'm struggling to insert data into a TdxMemData which is linked to a grid by a TDataSourse. The MemData -called PurchaseData- has 3 columns: Date (date), Place (string) and Value (currency). I have a button that does the following:
PurchaseData->Insert();
PurchaseData->FieldByName("Date")->Value = TDateTime::CurrentDate().DateString();
PurchaseData->FieldByName("Place")->Value = "";
PurchaseData->FieldByName("Value")->Value = 0.0f;
PurchaseData->Post();
Clicked once, it inserts a row normally and the data appears in a new row of the grid, but when clicking the button again I get a popup on the Insert() saying "Could not convert variant of type (Null) into type (String)".
I'm worried about the fact that the property "KeyFields" of the columns shows in its combo the field "RecId" besides the other 3 fields. I don't remember creating any column called RecId and if I did, I removed it. I can't figure out what it is and could not find help neither.