0 Replies Latest reply on Apr 4, 2012 6:44 PM by niyack44

    SQLite Insert, android: NEED HELP PLEASE

    niyack44 Level 1

      I have tried every sample code I coud find on doing an insert into SQLite and not matter what I do, the app just blinks at me and does nothing

      no error, no nothing.

       

      if I view the SQLite db using SQLite Database Browser 2.0, I can do an insert no worries.

      via action script, I can do an update no worries just not an insert

       

      PLEASE HELP!!!!

       

      I have Flash Builder 4.6

      Windows 7/ 64 bit

      the app is for an Android tablet

       

       

      var statement:SQLStatement = new SQLStatement();

                          statement.sqlConnection = dbConnection;                  

                         var sql:String = "INSERT INTO " + strGetFlightTableName + " (txtSortie, txtSeqNumber, txtEventID, txtEventFlightNo) VALUES ('" +

                              txtSortie.text + "','" + txtSeqNumber.text + "','" + txtEventID.text + "','" + txtEventFlightNo.text + "')";

                          statement.text = sql;

                                             

                          statement.addEventListener(SQLEvent.RESULT, insertResult);

                          statement.addEventListener(SQLErrorEvent.ERROR, insertError);

                         

                          statement.execute();

       

      or

                         

                          var sql:String = "INSERT INTO " + strGetFlightTableName + " (txtSortie, txtSeqNumber, txtEventID, txtEventFlightNo) VALUES (?,?,?,?)";

                         

                          var stmt:SQLStatement = new SQLStatement();

                          stmt.sqlConnection = dbConnection;

                          stmt.text = sql;

                         

                          stmt.parameters[0] = txtSortie.text;

                          stmt.parameters[1] = txtSeqNumber.text;

                          stmt.parameters[2] = txtEventID.text;

                          stmt.parameters[3] = txtEventFlightNo.text;

                         

                          stmt.execute();