vendredi 29 mai 2015

C++ SQLite - Fails to open database on mounted or networked drive

I cannot seem to get SQLite to open a database on a mounted network drive (if I am running from Windows) or just a network drive if I am running on Linux.

This statement always will fail:

string completePath = "file:///path/to/my/data/file.db3"

sqlite3_open_v2(completePath.c_str(), &_db, SQLITE_OPEN_URI, NULL) == SQLITE_OK

Other things I have tried (running on Linux):

  • sqlite3_open_v2((completePath+"?vfs=unix-dotfile").c_str(), &_db, SQLITE_OPEN_URI, NULL)

  • sqlite3_open_v2("/path/to/my/data/file.db3", &_db, SQLITE_OPEN_READONLY, NULL) (not setting the OPEN_URI flag)

  • sqlite3_open("/path/to/my/data/file.db3", &_db)

Same thing happens on Windows, if the db files are on a mounted drive. If the files are on a local drive (say C:), then everything is fine.

Thanks again for your help!

-Regards

Aucun commentaire:

Enregistrer un commentaire