deleting records

Submitted by Claire18 on
pls help me on how to delete records in visual basic 6.0. this the code that i am using but it did not allow me to delete the records... pls help..... fyi table that i used is "borrowers table". i also have my module and database... there is no error but it wont allow me to delete the records... Dim ANS As Integer ANS = MsgBox("Are you Sure You Want to Delete this Record", vbYesNo + vbCritical, "DELETE") If ANS = vbYes Then OpenDB SQL = "delete from borrowers where sid=' " & ListView1.SelectedItem & " ' " Set rs = New ADODB.Recordset With rs .Open SQL, cn, adOpenDynamic, adLockOptimistic MsgBox "Record Deleted!", vbOKOnly + vbCritical, "DELETE" End With 'rs.Close Set rs = Nothing cn.Close Set cn = Nothing End If View