....EZSQLException with mesage '0 record(s) updated. Only one record should have been updated."
Here is my code:
Code: Select all
if MainDM.adoRegistration.RecordCount = 0 then
MainDM.adoRegistration.Insert
else
MainDM.adoRegistration.edit;
Anode := httpxml.Root;
MainDM.adoRegistration.FieldByName('company').AsString := Anode.Items.ItemNamed['company'].properties[0].value;
MainDM.adoRegistration.FieldByName('address1').AsString := Anode.Items.ItemNamed['address1'].properties[0].Value;
MainDM.adoRegistration.FieldByName('address2').AsString := Anode.Items.ItemNamed['address2'].properties[0].Value;
MainDM.adoRegistration.FieldByName('city').AsString := Anode.Items.ItemNamed['city'].properties[0].Value;
MainDM.adoRegistration.FieldByName('province').AsString := Anode.Items.ItemNamed['province'].properties[0].Value;
MainDM.adoRegistration.FieldByName('postalcode').AsString := Anode.Items.ItemNamed['postalcode'].properties[0].Value;
MainDM.adoRegistration.FieldByName('phone').AsString := Anode.Items.ItemNamed['phone'].properties[0].Value;
MainDM.adoRegistration.FieldByName('country').AsString := Anode.Items.ItemNamed['country'].properties[0].Value;
MainDM.adoRegistration.FieldByName('email').AsString := Anode.Items.ItemNamed['email'].properties[0].Value;
MainFRM.listingBoardREG.WriteString('Theme\Logo', Anode.Items.ItemNamed['parentcompany'].properties[0].Value);
MainDM.adoRegistration.Post;
MainDM.adoRegistration.ApplyUpdates;
MainDM.adoRegistration.CommitUpdates;