Hi (unknown),
If you still need this.
Assuming that you are using the ADO.Net API to access the db, I've
implemented the "Read Only" parameter (that the C++ implementation has) for
this C# implementation. You can test it using the code from this
clone http://code.google.com/r/stewartadcock-csharp-sqlite-updates/ - it
works for me with Mono on Mac OS X, and I assume it will work on Windows
with .Net even though I haven't tested that yet.
To connect to a db in read-only mode, add "Read Only=True" to your
connection string, and then connect as normal. Any attempts to write to
the db will fail.
I have also implemented the SQLite3 "FailIfMissing" parameter. If set to
true, sqlite will not create an empty db in the case that the specified uri
doesn't exist. This is also derived from the C++ version's parameter of
the same name, to improve source-level compatibility.
Regards,
Stewart.
On Monday, 23 July 2012 20:37:53 UTC+1, (unknown) wrote:
> Hi, I'm looking to to use this great project in a metro style app, and
> would like to open an already-created file as a read-only database. I have
> no problem opening it in general, but I'm unclear on how to make the
> connection read-only.