none
syntax error into FROM clause comes.pls give writing entire code RRS feed

  • Question

  • Private

    Sub btnDelete_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnDelete.Click

     

    If con.State = ConnectionState.Open Then

    con.Close()

     

    End If

     

    Try

    con.ConnectionString =

    "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=F:\Final proj\HMS.mdb"

    sql =

    "DELETE FROM DeathRecord " & "WHERE IPD_No='" & txtIpdNo.Text & "'"

    cmd =

    New OleDbCommand(sql, con)

    con.Open()

    cmd.ExecuteNonQuery()

    MsgBox(

    "Record Deleted!", MsgBoxStyle.Information, "Delete")

    con.Close()

     

    Me.Close()

     

    Catch ex As OleDbException

    MsgBox(ex.ToString())

     

    End Try

     

    End Sub
    Monday, May 2, 2011 11:25 AM

Answers

All replies