Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Web and WebWorks Development

Reply
Trusted Contributor
Posts: 120
Registered: ‎10-25-2010
My Device: Not Specified

OpenDatabase FAIL only 5% of our employees

Hi,

 

We have deployed to our employees (100 people).

 

We are using BES.

 

5 people can't run the application because they can't create the database.

 

They are running a 9700 (OS : 5.0.351) and they have a sd card inserted.

 

 

function openNotesBase() 
{
    try {

        if (_db == null) {

            _db = openDatabase("notesBase", "1.0", "notesBase", 20000);

            if (_db != null) {
                _db.transaction(function(tx) {
                    tx.executeSql("create table if not exists Notes (id INTEGER,title TEXT,companyName TEXT, sector TEXT, facts TEXT, analysis TEXT,opinion TEXT,PublishingDate TEXT,CurrentPrice TEXT,TargetPrice TEXT,MarketCapName TEXT,CountryName TEXT,RecommendationCurrent TEXT,RecommendationPrevious TEXT,ReutersCode TEXT,BloombergCode TEXT,MarketCap TEXT,Ev TEXT,YtdAbs TEXT,YTDRel TEXT,BenchmarkIndexName TEXT,Phone TEXT,Email TEXT,AnalystPicture TEXT,BottomTable TEXT,Firstname TEXT,Lastname TEXT,IsPositive INTEGER,PublishingDateSmall TEXT,labelEv TEXT,NoteTypeId INTEGER);", null, null,
                    function(tx, error) {
                        alert("Impossible de créer la table : " + error.message);
                        return;
                    })
                });
            }
        }            
    }
    catch (e) {
        alert("OpenNotesBase : " + e);
    }
}

 

For the other employes, all is working fine.

 

 

Any idea ?

 

Thank you for your help

 

 

Trusted Contributor
Posts: 120
Registered: ‎10-25-2010
My Device: Not Specified

Re: OpenDatabase FAIL only 5% of our employees

I just asked the user to replace the sd card with another one and it works.

 

My question is :

 

1) Is the sd card bad ?

or

2) Is the database in the sd card corrupted ?

 

Is there a way to delete the database when it's corrupted and recreate one ?

Developer
Posts: 189
Registered: ‎08-13-2008
My Device: Not Specified

Re: OpenDatabase FAIL only 5% of our employees

Hi

 

You can goto the database file and delete it on the SD card.

 

1. goto Media

2. blackberry button - Explore

3. Media Card

4. blackberry button - Show Hidden

5. Blackberry

6. system

7. appdata

8. rim

9. webstorage

 

In webstorage you can have a look around and find the database file and delete it.

Trusted Contributor
Posts: 120
Registered: ‎10-25-2010
My Device: Not Specified

Re: OpenDatabase FAIL only 5% of our employees

thanks for the advice. I didn't know that it was possible to do it from the phone directly.

 

I would love to do the same steps from the application/widget.

I mean that if there is an error in my widget, I'd like to remove the database (corrupted) .

 

Is it possible ?