Dan,

I kept changing the DATABASE_NAME each time i compile not sure why it
would think it is the same database though.

I will try wiping the data. thank you.

On Apr 3, 8:52 pm, "Dan U." <[EMAIL PROTECTED]> wrote:
> Do you know if the database had previously been created? I'm thinking
> it did when you tested the notepad tutorial and therefore the
> DATABASE_CREATE never gets executed. Try wiping the data on the
> emulator.
>
> On Apr 3, 1:05 pm, Kevin Tan <[EMAIL PROTECTED]> wrote:
>
>
>
> > hi,
> >   I got an error on the emulator saying that the table new was not
> > found. From the debugger, I notice that the program never entered the
> > catch block, and therefore the table is not created. I borrowed this
> > code from the notepad tutorial and it worked fine when i did the
> > tutorial. Does anyone know what else I could be missing?
>
> >     private static final String DATABASE_NAME = "test";
> >     private static final String DATABASE_TABLE = "new";
>
> >     public FileShareDbAdapter open() throws SQLException {
> >         try {
> >             mDb = mCtx.openDatabase(DATABASE_NAME, null);
> >         } catch (FileNotFoundException e) { //this was never entered
> > even if i change the DATABASE_NAME to anything else
> >             try {
> >                 mDb =
> >                     mCtx.createDatabase(DATABASE_NAME,
> > DATABASE_VERSION, 0,
> >                         null);
> >                 mDb.execSQL(DATABASE_CREATE);
> >             } catch (FileNotFoundException e1) {
> >                 throw new SQLException("Could not create database");
> >             }
> >         }
> >         return this;
> >     }- Hide quoted text -
>
> - Show quoted text -
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Beginners" 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-beginners?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to