1. *** New version of B4J is available ***
    B4J v7.8
    Dismiss Notice

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


    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.Open("Data Source = " & AppPath & "\relevegeneraux.sl3")
    cmd.CommandText = "DELETE from gaz WHERE ROWID = idrow1"

    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:
    cmd.CommandText = "DELETE from gaz WHERE ROWID = " & idrow1
  3. gonzamax

    gonzamax New Member Licensed User

    Thank you very much
  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