0

I am using Visual Studio. Using VC++/MFC and SQLite, how would I programmatically create a database?

1
  • 2
    Just open it; the database file will be created automatically when needed. Commented Mar 19, 2014 at 8:56

2 Answers 2

1

You don't have to use a wrapper for doing that. You can simply use the sqlite3_open_v2 function with the SQLITE_OPEN_CREATE flag:

sqlite3* pDb = NULL;
int rc = sqlite3_open_v2("yourDbName.db", &pDb, SQLITE_OPEN_READWRITE | SQLITE_OPEN_CREATE, NULL);
assert(rc == SQLITE_OK);
Sign up to request clarification or add additional context in comments.

Comments

0

You need a Sqlite wrapper for C++.

You can find some here: http://www.sqlite.org/cvstrac/wiki?p=SqliteWrappers

One example is here: http://www.codeproject.com/Articles/6343/CppSQLite-C-Wrapper-for-SQLite

Comments

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.