Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 670773
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T00:18:03+00:00 2026-05-14T00:18:03+00:00

I’m developing an app in Visual C++ that uses an SQLite3 DB for storing

  • 0

I’m developing an app in Visual C++ that uses an SQLite3 DB for storing data. Usually it sits in the tray most of the time.

I also would like to enable putting my app in a DropBox folder to share it across several PCs.
It worked really well up until DropBox has recently updated itself.
And now it says that it “can’t sync the file in use”. The SQLite file is open in my app, but the lock is shared. There are some prepared statements, but all are reset immediately after using step.

Is there any way to enable synchronizing of an open SQLite database file? Thanks!

Here is the simple wrapper that I use just for testing (no error handling), in case this helps:

 class Statement
 {
 private:
  Statement(sqlite3* db, const std::wstring& sql) : db(db)
  {
   sqlite3_prepare16_v2(db, sql.c_str(), sql.length() * sizeof(wchar_t), &stmt, NULL);
  }

 public:
  ~Statement() { sqlite3_finalize(stmt); }

 public:
  void reset() { sqlite3_reset(stmt); }
  int step() { return sqlite3_step(stmt); }
  int getInt(int i) const { return sqlite3_column_int(stmt, i); }

  std::wstring getText(int i) const
  {
   const wchar_t* v = (const wchar_t*)sqlite3_column_text16(stmt, i);
   int sz = sqlite3_column_bytes16(stmt, i) / sizeof(wchar_t);
   return std::wstring(v, v + sz);
  }

 private:
  friend class Database;

  sqlite3* db;
  sqlite3_stmt* stmt;
 };


 class Database
 {
 public:
  Database(const std::wstring& filename = L"")) : db(NULL)
  {
   sqlite3_open16(filename.c_str(), &db);
  }

  ~Database() { sqlite3_close(db); } 

  void exec(const std::wstring& sql)
  {
   auto_ptr<Statement> st(prepare(sql));
   st->step();   
  }

  auto_ptr<Statement> prepare(const std::wstring& sql) const
  {
   return auto_ptr<Statement>(new Statement(db, sql));
  }

 private:
  sqlite3* db;
 };

UPD: Tried commenting out all calls to LockFile and LockFileEx in sqlite3.c – same result.

UPD2: Tried to call sqlite3_close when idle (just as proof of concept) – still same result! Filemon tells that file is still not closed, only unlocked.

UPD3: Autocommit mode is on. The numbers of BEGINs and COMMITs match (class Transaction and RAII take care of that). SQliteManager is able to connect to the DB while my app is running and make modifications to it.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-14T00:18:03+00:00Added an answer on May 14, 2026 at 12:18 am

    Checking the result from sqlite3_close(). Perhaps it is not working because you have not finalized all your prepared statements.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 412k
  • Answers 412k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer after snooping about I found this: CGContext context = UIGraphics.GetCurrentContext();… May 15, 2026 at 8:09 am
  • Editorial Team
    Editorial Team added an answer You need to ensure you're adding your dynamic control to… May 15, 2026 at 8:09 am
  • Editorial Team
    Editorial Team added an answer The '+' operator is defined for both strings and numbers,… May 15, 2026 at 8:09 am

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.