tags:

views:

25

answers:

0

I have the following code to open a database on the SDCARD and then update a value. If I run the code as is, it will generally run through without throwing an error but nothing gets updated.

If I single step through each line, it works perfectly. I have also tried adding SystemClock.Sleep(2000) in between each statement. Still, it does not run properly unless I single step through this section.

Any ideas?

SQLiteDatabase db = openOrCreateDatabase( sdDIR + "/DBNAME.db", SQLiteDatabase.CREATE_IF_NECESSARY, null);
db.execSQL("UPDATE tableName SET value='" + newValue + "' WHERE name='field_name';");
db.close();