1

I use the POCO library and I need to create a database SQLite at the beginning of my program so that I can then write and read data into it. How can I do it? I wrote the following code:

std::filesystem::path data_root_path("var/opt");
auto data_dir_path = data_root_path / "agent" / "data" / "module";
auto database_file = data_dir_path / "database.db";
// register SQLite connector
Poco::Data::SQLite::Connector::registerConnector();
database_ = Poco::makeShared<Poco::Data::Session("SQLite",database_file.string());

But I get the following error: FileNotFound I work on Linux OS, maybe I don't have access rights to create a database file? How can I check this? I gave the local user write access to the folder.

Could you tell me how to create a database file using the library POCO?

1

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.