SQLite Update Problem

Discussion in 'Questions (Windows Mobile)' started by david, Oct 9, 2007.

  1. david

    david Member Licensed User

    Hi Erel,

    I am having difficulty getting any sql updates to work.:sign0085:

    Please see the following code:

    Sub btnInsert_Click
    ' Temporary Code To Check Database Inserts or Updates (Depending On What has been commented out). This is only test code!

    ' Command.CommandText = "Insert Into LogNumber(Lognum, Descrip) Values('" & txtLogNum.Text &"', '" & txtLocation.Text & "')"

    ' Command.CommandText = "Insert Into LogNumber(Lognum, Descrip) Values( 'Test Number', 'Test Description' )"

    Command.CommandText "Update LogNumber Set Descrip = 'New Description'"

    End Sub

    The lines that have been commented out work fine when they are compiled in.

    That is I can insert records through variables or actual strings.

    I cannot update successfully whether or not I use variables or strings or a "Where" condition.

    It does work at the prompt with sqlite3 in a windows command window, so it is not a database issue?

    Am I doing something wrong?

    Also can you point me to code that tells me how to capture sql database exceptions and provide the appropriate error messages.

    Thank you very much.


  2. Erel

    Erel Administrator Staff Member Licensed User

    I've checked this code (on the desktop and the device) and it works properly:
    Cmd.CommandText = "UPDATE table1 SET col2 = 'new value' WHERE col1 = '136'" 
    You could catch all errors with ErrorLabel.
    What kind of errors do you want to catch?
  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