How do I connect multiple sqlite files into a single sqlite3* handle, in C/C++? I’m thinking it’s possible considering there’s a command called ATTACH, but do not know how to do so in C++. Thanks in advance.
Answer (thanks to Robert)
sqlite3_exec(db, "ATTACH 'C:/tmp/tmp.sqlite' as mytmp");
Execute the
ATTACH DATABASESQL command:You can then refer to tables in the attached database as:
http://www.sqlite.org/lang_attach.html