On Sun, 24 Oct 2010 20:57:15 +0800, Mohd Radzi Ibrahim <mra...@pc.jaring.my> wrote:
> Hi, > I am planning to deploy my sqlite database together > with the exe file. Is there a way to open the sqlite > database with a file handle and starting offset of > the file, as read-only? > > Thank you for any suggestion. Not out of the box. I can think of three solutions: 1- Difficult: change the sqlite3 library in such a way so it uses the whole executable as the "first page" of the database 2- Easier: Store the output of the .dump command of the sqlite3 shell in a 'resource' in the executable and on execution of your program read the resource and load it in an in-memory database (filename ":memory:" ) by calling sqlite3_exec() on each of its statements. 3- Easier: Store the database file as-is in a resource in the executable and on execution of your program write it to disk and open it in the normal way. HTH -- ( Kees Nuyt ) c[_] _______________________________________________ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users