hey
im using the below code to create the database and its working fine,
except that when im watching the LogCat i saw the error msg : "Failed
to
open database file "/data/data/com.myAPP/database/DB.db" - unable to
open
database file" (i saw this under the "E" (ERROR) section) ,
but as i saw it, it doesnt need to be like this because when im going
to
create new DB i will always failed to open the DB ... so why i need to
get the error msg at the LogCat ?

[code]
public class DalForPassTable
{
   private static class DatabaseHelper extends SQLiteOpenHelper {

        @Override
        public void onCreate(SQLiteDatabase db) {
               db.execSQL("create table logins (username text primary
key,"
                       + "password text not null"
                       +");");
                   }

        @Override
        public void onUpgrade(SQLiteDatabase db, int oldVersion, int
newVersion) {
              db.execSQL("DROP TABLE IF EXISTS logins");
            onCreate(db);
        }
    }

    private static final String DATABASE_NAME = "DB.db";
    private static String DATABASE_TABLE ="logins";
    private static final int DATABASE_VERSION = 1;
    private SQLiteDatabase db;

    DalForPassTable(Context ctx)
    {
       DatabaseHelper dbHelper = new DatabaseHelper();
        db = dbHelper.openDatabase(ctx, DATABASE_NAME, null,
DATABASE_VERSION);
    }
    ...
}

[/code]
thanks
--~--~---------~--~----~------------~-------~--~----~
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]
Announcing the new M5 SDK!
http://android-developers.blogspot.com/2008/02/android-sdk-m5-rc14-now-available.html
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to