Dim strDelete, sqlDetect As String
strDelete = InputBox("Please enter valid Borrower's ID to delete", "Delete")
open_con()
cmd = New OleDbCommand("DELETE FROM tblBorrower WHERE bor_id LIKE '" & strDelete & "'", con)
dr = cmd.ExecuteReader
If dr.Read() Then
If strDelete = dr("bor_id") Then
cmd.ExecuteNonQuery()
MsgBox("Item deleted", MsgBoxStyle.Information, "Delete Success")
Else
MsgBox("Unable to delete", MsgBoxStyle.Exclamation, "Message")
End If
End If
If strDelete <> dr("bor_id") Then
MsgBox("Item not found or item not exist", MsgBoxStyle.Exclamation, "Delete Error")
End If
dr.Close()
cmd = Nothing
con.Close()
my question is:
i want to delete the row or data in database mysql2000,but when i delete press delete it says unable to delete but the row was deleted... any idea plz... i need help really badly... can you correct my codes sir and show me the correct codes if you may... sorry for my bad english... hope you help me out...
strDelete = InputBox("Please enter valid Borrower's ID to delete", "Delete")
open_con()
cmd = New OleDbCommand("DELETE FROM tblBorrower WHERE bor_id LIKE '" & strDelete & "'", con)
dr = cmd.ExecuteReader
If dr.Read() Then
If strDelete = dr("bor_id") Then
cmd.ExecuteNonQuery()
MsgBox("Item deleted", MsgBoxStyle.Information, "Delete Success")
Else
MsgBox("Unable to delete", MsgBoxStyle.Exclamation, "Message")
End If
End If
If strDelete <> dr("bor_id") Then
MsgBox("Item not found or item not exist", MsgBoxStyle.Exclamation, "Delete Error")
End If
dr.Close()
cmd = Nothing
con.Close()
my question is:
i want to delete the row or data in database mysql2000,but when i delete press delete it says unable to delete but the row was deleted... any idea plz... i need help really badly... can you correct my codes sir and show me the correct codes if you may... sorry for my bad english... hope you help me out...