Hi, Looks like you have not provided the value be to inserted (?) before compiling the statement, have a look in the logcat for error messages. Also try finding a valid insert example.
Regards On Sep 17, 5:05 am, mwllace <[email protected]> wrote: > Im trying to use a datahelper class for my android database, and there > is one line that when executed causes my app to "quit unexpectedly". > Im using android 2.2 Library. > > this.insertStmt = this.db.compileStatement(INSERT); // < Crashes the > emulator > > When I comment the line out the app runs fine, but I cant use insert > because I cant get this line work. No errors are reported in eclipse > before I run the app in the emulator. Any ideas what this may be? > > Thanks! > > private SQLiteDatabase db; > private SQLiteStatement insertStmt; > > private static final String INSERT = "insert into " + TABLE_NAME + > "(name) values (?)"; > > public DataBaseHelper(Context context) { > this.context = context; > OpenHelper openHelper = new OpenHelper(this.context); > this.db = openHelper.getWritableDatabase(); > this.insertStmt = this.db.compileStatement(INSERT); // < > Crashes the emulator > > ..... > > > > > > > > } -- You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/android-developers?hl=en

