P
P
Pavel Kaptur2017-03-18 16:00:50
C++ / C#
Pavel Kaptur, 2017-03-18 16:00:50

Why is the database not being created?

Hello everyone, tell me, I'm trying to create a sqlite database, well, save something into it, but every time I get an SQLITE_CANTOPEN error. Same code on linux and everything works.

int ConnectDB(const char* dbname, sqlite3** db, int Parameters)
{
  int res = sqlite3_open_v2(dbname, db, Parameters, 0);
  return res;
}
bool SaveSettingsToDataBase(char* dbname, char* tablename, HotKey& key)
{
  sqlite3 *db = 0;
  //wchar_t *err;
  if (SQLITE_OK != ConnectDB(dbname, &db, SQLITE_OPEN_READWRITE | SQLITE_OPEN_CREATE))
    return false;

  CreateTable(db, tablename);
  if (SQLITE_OK != addDataRow(db, tablename, key))
    return false;
  return true;
}

business does not go further ConnectDb, the error is the same. During the opening of the database, the machine is stupid for about 1.5 seconds and returns an error. I use Amalgam sqlite

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question