×

Discussion Board

Results 1 to 2 of 2
  1. #1
    Registered User
    Join Date
    Sep 2011
    Posts
    1

    Question Unable to use the existing database using javascript in QML on symbian device?

    I am developing the application for symbian device in QML . I am using these lines to connect with database through javascript function.

    Code:
    db = openDatabaseSync("mydatabase", "1.0", "mydatabase", 1000000);
    I changed the data storage path like this:

    Code:
    QDeclarativeEngine engine;
    engine.setOfflineStoragePath(QString("E:\\"));
    When i deploy the application in debugging mode on device. It creates the folder “Databases” in “E:” drive with .ini file in it but it does not create the database file(.sqlite).

    At this line

    Code:
    tx.executeSql('CREATE TABLE IF NOT EXISTS Greeting(salutation TEXT, salutee TEXT)');
    It gives me this error

    Code:
    [Qt Message] QSqlQuery::prepare: database not open
    [Qt Message] file:///C:/Private/e15a05d0/qml/NokiaApp/jscript.js:15: Error:
    When i googled it, I found that it would be created at the path something like this C:\Private\e15a05d0\” . I am unable to find the private folder in C drive. Its hidden. How can i access that? If i create the new database at default path, then i am unable to locate those database files on device.

    I want to use existing database. There are hundreds of records in my database. How can i make sure that deployment process should deploy the same database which i created on windows.

    I didn’t find any help in documentation. Can anyone resolve this issue?

    Thanks in advance.

  2. #2
    Nokia Developer Champion
    Join Date
    Feb 2005
    Location
    Karachi, Pakistan
    Posts
    277

    Re: Unable to use the existing database using javascript in QML on symbian device?

    Yes, private folder is hidden on Symbian OS. Only apps with the same UID can access it's own private folder.

    You can package additional files along with your main application, which will then be installed along in private folder.

    All you need to do is add the additional files and folders in top of your .pro file. Like below example:

    Code:
    # Add more folders to ship with the application, here
    folder_01.source = dbFolder
    folder_01.target = dbFolder
    DEPLOYMENTFOLDERS = folder_01
    This will add all files inside dbFolder into SIS, and when installed, it will unpack this folder inside your app's private folder. So, path will be like /private/uid/dbFolder

    I hope this helps,

    // chall3ng3r //
    Faisal Iqbal (skype: chall3ng3r)
    Flash Mobile Specialist | Orison Technologies
    _____________________________________
    blog: F·L·A·S·H·I·S·M
    swf2go: www.swf2go.com

Similar Threads

  1. Add existing Sqlite database to Qt project
    By santijdelatorre in forum Qt
    Replies: 31
    Last Post: 2011-05-15, 01:20
  2. Install application with existing sqlite database in mass storage in symbian(N-97)...
    By Yogesghpatel in forum [Archived] Nokia Smart Installer for Symbian
    Replies: 2
    Last Post: 2011-01-22, 09:21

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •