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
Developer
Posts: 37
Registered: ‎12-24-2010
My Device: Tour
My Carrier: Verizon

Sqlite error in OS 5.0 and 6.0

Occasionally I get emails from app users stating that an error has occured with the app that they downloaded. It looks like the sqlite database is not creating successfully and I have been unable to reproduce the error.  The code looks like the following:

 

 

 

  db = openDatabase('<database name>', '1.0', '', 10000);

 

 

The db object is nothing so an error message is returned to the end user. I have verified that they have a memory card in their phone and have a supported operating system. 

 

 

 

 

Are there any known issues when trying to create a sqlite database in webworks apps? I have tried to replicate the error on my phone by changing multiple settings on the phone, but I have had no luck.  

 

 

 

 

 

 

 

 

 

 

 

Retired
Posts: 3,708
Registered: ‎10-16-2008
My Device: Z10
My Carrier: Rogers

Re: Sqlite error in OS 5.0 and 6.0

Are they connecting their smartphone to via their USB cable and turning on mass storage mode to transfer files to the device?

 

If so, it will make database access unavailable.  You can check the blackberry.system.isMassStorageActive() before accessing the database.  I have seen before on some builds of OS 6 that you must close the application and restart it when this happens.

Tim Neil
Director, Application Platform & Tools Product Management
Follow me on Twitter
Developer
Posts: 37
Registered: ‎12-24-2010
My Device: Tour
My Carrier: Verizon

Re: Sqlite error in OS 5.0 and 6.0

Unfortunately they are not using mass storage mode. They have a memory card in their phone and we tried restarting their phone.

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

Re: Sqlite error in OS 5.0 and 6.0

Not sure if this is relevant for you.

 

But I have seen errors when creating Databases if the user is OFFLINE or out of coverage at the time of creation.

It returns a null pointer from the OpenDatabase function.

 

So a user has to be online to create the initial database.

 

Cheers

 

Andrew

 

 

Developer
Posts: 37
Registered: ‎12-24-2010
My Device: Tour
My Carrier: Verizon

Re: Sqlite error in OS 5.0 and 6.0

I did not ask if they were offline at the time. I will ask.  Thank you.

Highlighted
Developer
Posts: 37
Registered: ‎12-24-2010
My Device: Tour
My Carrier: Verizon

Re: Sqlite error in OS 5.0 and 6.0

I heard back from the end user and he had to reformat his media card and then the app worked.