Hello,
i want to update values in my database and i keep getting "Database
not open".
To clarify: I am porting an app from 0.8 to 1.0. Everything worked in
0.8.
The Update was done through execSQL() and a string SQL statement and
i got "out of memory" errors while trying to execSQL() (note, that
using the exact same string
in the adb shell was no problem, so the SQL statement was right).
I did change to SQLDatabase.update() and ContentValues now, and the
out of memory is gone,
i get "database not open".
Considering the following code, how can the database not be open?
if (!myDB.isOpen())
myDB=dbhelper.getWritableDatabase();
if (myDB!=null && myDB.isOpen())
{
m.total=getAttendees().size();
ContentValues vals = new ContentValues();
vals.put("name", m.name);
vals.put("latitude", m.latitude);
vals.put("longitude",m.longitude);
vals.put("initiator_tel", m.initiator);
vals.put("day", m.day);
vals.put("month", m.month);
vals.put("year", m.year);
vals.put("hour", m.hour);
vals.put("minute", m.minute);
vals.put("duration", m.duration);
vals.put("accepted", m.accepted);
vals.put("total", m.total);
vals.put("notes", m.notes);
myDB.update(MY_MEETINGS_TABLE, vals, "meetings_id"+"="+m.id,
null);
}
else Log.d("LocPickMeetings", "DB could not be opened!!");
myDB.close();
Both If's are executed, so myDB is not open in the beginning and isOpen
() in the update-Process.
I get "IllegalStateException: database not open" on the update() line,
though.
Any hints? Ideas? Where did i go wrong?
Also the DBHelper works, as i am reading and writing into the database
prior to this.
Regards, Sebastian
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---