1 Reply Latest reply on Sep 5, 2009 12:26 AM by Hitesh_Patel

    Unable to insert data into SQLite DB from AIR

    Hitesh_Patel Level 1

      Hi,

       

      I have the following Test table structure:

       

      Table [TEST]
          Fields: 2
              [TEST1]: VARCHAR2
              [TEST2]: VARCHAR2

       

      and the following AS code:

       

      var statement:SQLStatement = new SQLStatement();

      statement.sqlConnection = conn;         //conn is a valid Connection Object


      strQuery = "INSERT INTO TEST(TEST1, TEST2) VALUES(:TEST1, :TEST2)";
      statement.parameters[":TEST1"] = "TEST1";
      statement.parameters[":TEST2"] = "TEST2";
      statement.text = strQuery;

      statement.execute();

       

      I dont get any errror, the insert statement seems to be successful. However, the data does'nt go into the table. When I refresh the table, there are no new records. My DB extension is .db.

       

      Am I going wrong somewhere? Please help. I am new to AIR.

       

       

      Thanks,

      Hitesh Patel

        • 1. Re: Unable to insert data into SQLite DB from AIR
          Hitesh_Patel Level 1

          My issue got resolved.

           

          The data was getting inserted properly but the database that was used during runtime was in "bin-debug" folder. Hence I as not able to see the changes,

           

          I have hardcoded the path to my actual database for the development work and its working fine now.

           

          Hope this information might be helpful to someone else as well.

           

          Regards,

          Hitesh Patel