Delete a row in a table and simultaneously delete it in the database

Discussion in 'Questions (Windows Mobile)' started by gonzamax, Dec 24, 2007.

  1. gonzamax

    gonzamax New Member Licensed User

    Hello,

    I have a table which is filled in by a database and I want to delete data in the database, after I have selected a row in the table.

    I give you the code of my SQL request

    Con.New1
    Cmd.New1("",con.Value)
    Con.Open("Data Source = " & AppPath & "\relevegeneraux.sl3")
    cmd.CommandText = "DELETE from gaz WHERE ROWID = idrow1"
    Cmd.ExecuteNonQuery
    Con.Close

    I don't know how to make idrow1 appear as a variable in the request.

    Thank You
     
  2. Erel

    Erel Administrator Staff Member Licensed User

    CommandText is just a string, so you should use '&' to insert a variable inside:
    Code:
    cmd.CommandText = "DELETE from gaz WHERE ROWID = " & idrow1
     
  3. gonzamax

    gonzamax New Member Licensed User

    Thank you very much
     
Loading...
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice