[Firedac][Dats]-16. Cannot process - no Parent. Constraint [Foreingnkeyconstraint]

Asked

Viewed 697 times

0

I have a link master detail Using Delphi Mysql and Firedac (adquery) I had a screen with client/contact data, recorded perfectly smoothly master detail used as the example of the http://alan-gomes.blogspot.com.br/2013/04/firedac-cadastro-mestredetalhe.html everything worked perfectly but without any change suddenly I started receiving the mens [Firedac][Dats]-16. Cannot process - no Parent. Constraint [Foreingnkeyconstraint] When I only record the father without including anything in the son he records perfectly but when I include some item in the son appears to mens. I even tried debugging, but the error already happens when recording the father before even trying to record the child.

  • If you post the part of your code that you find relevant and also the schema of the tables (a generated CREATE TABLE, for example) can be useful.

  • I did not find how to send file here so follow the link to the mysql database script and the relevant sources : Source http://msdeveloper.com.br/download/Phibro.zip http database script://msdeveloper.com.br/download/Phibro.sql // the error can be verified in the client or product registration, where it happens in the children of these.

  • Ailton, no need to send files, just paste the code into the question itself.

  • nor has code... ta so... adQueri1 (Father) adQueri2 (Son) the two linked to prop. chemaAdapter = ADSchemaAdapter os dois adQuery esta com a propriedade cacheupdata = true, e no filho esta ADFetchOptions/DatailCascade = true e o filho esta ligado ao pai com mastersource = adquery1 / masterfield = cliente_id e o indexfieldsname = cliente_id .... continues

  • e no codigo do botao salvar esta assim : 
if (cdsContato.State in [dsInsert,dsEdit]) and ((not cdsContatotipo_contato_id.IsNull) and (not cdsContatodados.IsNull) ) then
 Begin
 if cdsMaster.State in [dsInsert,dsEdit] then
 cdsMaster.Post; cdsContact.Post; Application.Messagebox('Contact Recorded successfully!', 'System Warning',MB_OK); End;

  • I don’t know if Oce can visualize this situation but when I don’t use a child it works perfectly, but if I add a child it doesn’t matter how to record the error. even if I put a dbgrid father and son and roll the screen up and down to record the dick. if you use the post command, or simply an Insert that will automatically save the record that is being edited already from the stick.

Show 1 more comment
No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.