OS - Windows The encoding of the input string is unknown, but most likely Windows will be. Project file encoding is a set of unicode characters. Language - C ++

The problem is that it cannot connect to the database in another explicitly specified directory ("file: C: /Users/Public/Desktop/testDb.sqlite") it simply does not appear ... However, the address specified relative to the current directory where the program is located is an example: ("SqLite / testDb.sqlite")

A wrapper class constructor that simultaneously connects to the base the following:

CSqliteManager::CSqliteManager(const char* dbName) { db = nullptr; int rc = sqlite3_open(dbName, &db); if (rc != SQLITE_OK) { db = nullptr; } } 

Tell me how to change the line to connect or something else so that no one else has any problems? The program will be on computers with Windows used.

  • and what does sqlite3_errmsg() say when it fails to open the database? - Fat-Zer
  • @ Fat-Zer #define SQLITE_CANTOPEN 14 / * Unable to open the database file * / - JamesBondCaesar
  • one
    file:C:/Users/Public/Desktop/testDb.sqlite ” - slash (s) after file: missing only here or in the source too? in errno there is no additional information? - Fat-Zer
  • @ Fat-Zer I tried both with slashes so without them ... Not as it is impossible. If it's not difficult for you, then run the enclosed code snippet at your place, it may be interesting for me only to have such a problem ... - JamesBondCaesar
  • @ Fat-Zer Bft may have problems with the rights of the record or something else that nibul ... only I don’t know how to check it on windows (and can it be like that, because I’m sitting under the user - Administrator) - JamesBondCaesar

0