• Welcome to Theos PowerBasic Museum 2017.

DAO and Delete recordset

Started by Ian Bayly, March 15, 2009, 05:34:10 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Ian Bayly

José

In your example DAO: Delete record
http://www.jose.it-berater.org/smfforum/index.php?topic=2643.0
Only the current record is deleted (in this case the last record).
How would I amend this example such that the complete recordset is deleted?
Looking at ADO examples it appears that a modifier after the delete handles this, but I can't see anything similar for DAO in the inc files.

Ian B

José Roca

 
DAO's Delete method has not parameters. You will need to use a loop using MoveFirst and Delete until there are not records in the recordset.

Matt Humphreys

Have you considered (I may be completely off point with what you are trying to achieve here)...

SqlStr = UCODE$("DELETE * FROM Authors")
pDatabase.Execute(SqlStr)

Ian Bayly

Thank you both for your responses.
Matt your code is exactly what I need, I couldn't find an example showing the execute SQL instruction.

Again - thanks.

Ian B