There is a deleteDatabase method that the Activity class inherits from
the Context class.
  I have not tried, but you can try doing something like this.

     this.deleteDatabase(R.string.app_name);

On Apr 17, 5:28 am, Zhubham <[email protected]> wrote:
> Hi,
>
> In my application i take some input from the user and store it in
> sqlite database. Now, if on second visit to save records menu, I give
> the previous file name then the database holding above file should be
> dropped and a new database should be made.
>
> I do this by :
>
> public void deleteRecord()
>     {
>         try
>         {
>                 db.execSQL("DROP TABLE IF EXISTS " +DATABASE_TABLE);
>                                 db.execSQL("VACUUM");
>                 }
>         catch(SQLException sqle)
>         {
>                                 sqle.printStackTrace();
>         }
>
>     }
>
>  However, on doing this the previous records are not getting deleted.
> With this, the new records get appended to the previous ones.
>
> Can u please help me with this??
>
> Thanks in advance.
>
> Best Regards,
> Zhubham
>
> Muthu Ramadoss wrote:
> > Use drop database sql command directly.
>
> > On Apr 2, 2009 7:24 PM, "Zhubham" <[email protected]> wrote:
>
> > Hi,
>
> > I need to introduce a menu option on clicking which the whole SQLite
> > database file stored at "data/data/com.company.packName/databases/"
> > gets deleted. Using DROP TABLE command would only delete the table
> > under a particular database.
>
> > How can i achieve this??
>
> > Thanks in advance.
>
> > Best Regards,
> > Zhubham

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Android Discuss" 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-discuss?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to