Attach database B to database A - How to specify the path?

Nov 29, 2013 at 2:52 PM

Database A is located directly in the IsolatedStoreFile root folder (the local folder). I am trying to attach database B to A. B is located in a subdirectory:
Attach query on A:
"ATTACH '/subdir/B.sqlite' as AttachedDB"
This query fails with the return code "DatabaseOpenError". This problem does not occur if B is locates in the same folder as A:
"ATTACH 'B.sqlite' as AttachedDB"
But how can I attach a db that is located in a different folder? How to specify the path correctly?
Nov 30, 2013 at 7:03 AM
This is issue is solved as well. The path to B has to be fully quantified:
String pathToB = "\subfolder\B.sqlite";

StorageFolder localFolder = ApplicationData.Current.LocalFolder;
localFolderPath = localFolder.Path;

pathToB = localFolderPath + pathToB;