how do i delete all the data which is stored in the sql table????
i want to delete only the data present in one table without dropping the table when i click on the command button in vb6 plz help :(:(:(:( its really urgent
"Recordset.Delete" will only delete the active row. You either have to iterate through the recordset and advance the current row or do what @debasisdas says. Please don't post if you haven't tested your solution.
Noted. It didn't work in the test I did, so please share your scenario that DID work. We're all about learning here, I'm curious to see your complete solution.
I tested with VB6 using an ADODC control connected to a SQL2008 backend. If convenient, please post important details, including database engine, connection string (except passwords, of course :D), surrounding control types, and so on. Personally, I'm interested in solving the problem for the OP. If I can learn something along the way, that's a bonus.
sql = "DELETE FROM customers"
sq l= sql & " WHERE customerID='" & cid & "'"
on error resume next
if err<>0 then
MsgBox.Show "No update permissions!"
MsgBox.Show "Record " & cid & " was deleted!"