how to delete the records?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • itoxic07
    New Member
    • Aug 2007
    • 2

    how to delete the records?

    how to delete the records ?

    i am having problem deleting the records including the duplicate records from access database.
    I inserted a textbox on a form ,the name written in a textbox must be deleted
    including duplicate names from database
  • hariharanmca
    Top Contributor
    • Dec 2006
    • 1977

    #2
    Originally posted by itoxic07
    how to delete the records ?

    i am having problem deleting the records including the duplicate records from access database.
    I inserted a textbox on a form ,the name written in a textbox must be deleted
    including duplicate names from database

    just exeecute the query

    strsql = "Delete * from tblTableName Where txtFieldname like '" & trim(txtDeleteN ame.Text) & "'"

    Comment

    • slapshock
      New Member
      • Oct 2006
      • 57

      #3
      dim rs as new adodb.recordset
      rs.open "Delete * from tblTableName Where txtFieldname like '" & trim(txtDeleteN ame.Text) & "'"

      try this code, hope it will help

      happy coding

      Comment

      • fplesco
        New Member
        • Jul 2007
        • 82

        #4
        Originally posted by slapshock
        dim rs as new adodb.recordset
        rs.open "Delete * from tblTableName Where txtFieldname like '" & trim(txtDeleteN ame.Text) & "'"

        try this code, hope it will help

        happy coding
        Hey guys -

        What are you trying to do with txtFieldname? It must a textbox object right? Not a field name. Are you trying to pass a FIELD/ COLUMN name into this query?

        It should look like this.

        Code:
        "Delete * from tblTableName Where " & txtFieldname & " like '" & trim(txtDeleteName.Text) & "'"
        Or just a specific fieldname like
        Code:
        "Delete * from tblTableName Where Lastname like '" & trim(txtDeleteName.Text) & "'"
        Note: In MS SQL Server backend, DELETE command DOES NOT NEED an *. For example: DELETE FROM <table name> WHERE <field/column name> [= / LIKE] <value>

        Comment

        Working...