locked
Is it possible to use a SqlLite file from a directory other than LocalStorage RRS feed

  • Question

  • I can successfully connect to a sqlite file located in LocalStorage but not other locations such as PicturesLibrary.

    Has anyone else had this issue? or know of a fix without copying the file from the other folders into LocalStorage since Im working with an 8Gig sqlite file.

    Cheers,


    • Edited by Native Code Thursday, November 7, 2013 4:05 AM
    Thursday, November 7, 2013 3:53 AM

Answers

  • No. SQLlite depends on having direct access to read and write the database file. Your app has direct access only to its install directory (read only) and application data directories (read and write). The app can only access the libraries via StorageFolders, which SQLlite does not use.

    See File access and permissions .

    --Rob

    • Marked as answer by Native Code Thursday, November 7, 2013 8:23 PM
    Thursday, November 7, 2013 4:03 AM
    Moderator

All replies

  • No. SQLlite depends on having direct access to read and write the database file. Your app has direct access only to its install directory (read only) and application data directories (read and write). The app can only access the libraries via StorageFolders, which SQLlite does not use.

    See File access and permissions .

    --Rob

    • Marked as answer by Native Code Thursday, November 7, 2013 8:23 PM
    Thursday, November 7, 2013 4:03 AM
    Moderator
  • Hello Native Code,

    try to give file access permission in project using package.appxmanifiest file. than use this code : 

    StorageFile fo = await KnownFolders.PicturesLibrary.GetFileAsync("your sqlite database file name");
                SQLiteAsyncConnection conn1 = new SQLiteAsyncConnection(fo.Path);

    Thursday, November 7, 2013 4:47 AM
  • Hello Native Code,

    try to give file access permission in project using package.appxmanifiest file. than use this code : 

    StorageFile fo = await KnownFolders.PicturesLibrary.GetFileAsync("your sqlite database file name");
                SQLiteAsyncConnection conn1 = new SQLiteAsyncConnection(fo.Path);

    I'v tried that previously but it doesn't work.

    Thursday, November 7, 2013 8:23 PM