I have tested a SQLite database with the typical, working like a charm:

Path.Combine(Windows.Storage.ApplicationData.Current.LocalFolder.Path, 
"db.dat");

I wanted to create the database in an external storage, to do that I need to 
add the following steps:

1.- Add Capability to use removablestorage.
2.- Add file type association in order to have rights to manage that kind of 
files

(The details here: 
http://expediteapps.com/blog/data-logger-with-windows-10-iot-in-progress/) 

So then I change the path to the removable storage path like ?E:\db.dat? and it 
always tells CannotOpen.
(I can work with text .dat files without issues.)

The SQLite library PCL It arrives to here:

SQLiteApiWinRT.cs

public Result Open(byte[] filename, out IDbHandle db, int flags, IntPtr zvfs)
                {
                                Sqlite3DatabaseHandle internalDbHandle;
                                var ret = (Result)SQLite3.Open(filename, out 
internalDbHandle, flags, zvfs);
                                db = new DbHandle(internalDbHandle);
                                return ret;
                }

Where Open is

[DllImport("sqlite3", EntryPoint = "sqlite3_open_v2", CallingConvention = 
CallingConvention.Cdecl)]
public static extern Result Open(byte[] filename, out IntPtr db, int flags, 
IntPtr zvfs);

where I am using:

SQLite.UAP.2015, Version=3.8.10

And here is where the road ends, any help? I do not know in where the string is 
converter to storagefile or whatever way is accessing to the file, any clues?

NOTE: I have used ??????? ??????? Libraries too, arriving to the same point, so 
I can assure that is internal, but I do not know how to continue.

Thank you!


Juan Pablo Garcia Coello
Co-Founder & CTO

www.expediteapps.com
www.expediteapps.com/blog

Reply via email to