I have a very unusual problem.

I'm trying to create a simple database (6 tables, 4 of which only have 2 columns).
I'm using an in-house database library which I've used in a previous project, and it does work.

However with my current project there are *occasional* bugs. Basically the database isn't created correctly. It is added to the sdcard but when I access it I get a `DatabaseException`.

When I access the device from the desktop manager and try to open the database (with SQLite Database Browser v2.0b1) I get "File is not a SQLite 3 database".

**UPDATE**  

I found that this happens when I delete the database manually off the sdcard.
Since there's no way to stop a user doing that, is there anything I can do to handle it?

**CODE** 

```
public static boolean initialize()
{
    boolean memory_card_available = ApplicationInterface.isSDCardIn();
    String application_name = ApplicationInterface.getApplicationName();
    if (memory_card_available == true)
    {
        file_path = "file:///SDCard/" + application_name + ".db";
    }
    else
    {
        file_path = "file:///store/" + application_name + ".db";
    }

    try
    {
        uri = URI.create(file_path);
        FileClass.hideFile(file_path);
    } catch (MalformedURIException mue)
    {
    }

    return create(uri);
}

private static boolean create(URI db_file)
{
    boolean response = false;

    try
    {
        db = DatabaseFactory.create(db_file);
        db.close();

        response = true;
    } catch (Exception e)
    {
    }

    return response;
}

```