Here I am again. I would like to understand why in this cycle the records of the tables are not deleted … I have a main table IntestazioneFatturaAcqusiti where there is an ID, with this ID I connect to another table CorpoFattureAcquisti where it is allocated to recognize all the articles belonging to the main table. I would like to delete the main ID and consequently, delete on the second table all the IDs connected to the first … but it only deletes 1.
rs = db.SelectSQL("SELECT * FROM IntestazioneFatturaAcquisti WHERE "+DenominazioneCampoDataNellaTabellaDB+" >= " +txtStart +" and "+DenominazioneCampoDataNellaTabellaDB+" <"+txtEnd)
While Not rs.AfterLastRow
rs2 = db.SelectSQL("SELECT * FROM CorpoFatturaAcquisti where Id_IntestazioneFattura=" + rs.Column("ID").StringValue)
While Not rs2.AfterLastRow
rs2.RemoveRow
rs2.MoveToNextRow
wend
rs.RemoveRow
rs.MoveToNextRow
wend
3 posts - 2 participants