Is it possible : fill the SQLUpdate property with 2 Statements

Is it possible : fill the SQLUpdate property with 2 Statements

Postby swierzbicki » Thu 18 Aug 2005 08:06

Hi,

I have a master (with an autoinc field) query.
A detail query is linked to the master query.

After inserting and posting a master record, I want to automatically insert a record into the detail table.

I first choose the OnBeforePost event of the master table. But this isn't a good solution : it is triggered after dsedit / dsinsert state.

Then,on the master query, I launch the mysqlEditor and I've generated the SQL statements. In the SQL Insert statement, I've added a second statement that will fill the detail table given the master query autoinc field.

Insert went fine, but the second statement wans't executed.
Is there any workarround ?

Thank you
swierzbicki
 
Posts: 451
Joined: Wed 19 Jan 2005 09:59

Postby Ikar » Mon 22 Aug 2005 11:46

Try to use AfterPost event
Ikar
 
Posts: 1693
Joined: Thu 28 Oct 2004 13:56

Postby swierzbicki » Mon 22 Aug 2005 12:36

Ok, AfterPost seems the easiest solution, but how to know if the "afterpost event" cames is fired by an insert/append or an edit event ?
swierzbicki
 
Posts: 451
Joined: Wed 19 Jan 2005 09:59

Postby Ikar » Mon 22 Aug 2005 13:29

Try to set any flag on BeforeInsert and discard it on BeforeEdit.
Ikar
 
Posts: 1693
Joined: Thu 28 Oct 2004 13:56


Return to MySQL Data Access Components