I was going by the comment at http://www.sqlite.org/c_interface.html which says:
"If the file is read-only (due to permission bits or because it is located on read-only media like a CD-ROM) then SQLite opens the database for reading only." I don't know how true this is but I assume that since one of the error codes is SQLITE_READONLY then it is probably accurate. In which case an extra function that returns the state of the read-only flag would be nice. On Tuesday, March 09, 2004, at 11:22AM, Peter <[EMAIL PROTECTED]> wrote: >Steve Palmer wrote: >> Is there an easy way I can open a database via sqlite_open and then find out if >> sqlite has opened it in read-only mode without first needing to do any sort of >> modification and get an error code? I want to adjust the UI in my application to >> disable certain functionality if the database is read-only. > >See Sqlite.h, near declaration of sqlite_open: >** The Truth: As currently implemented, all databases are opened >** for writing all the time. Maybe someday we will provide the >** ability to open a database readonly. The mode parameters is >** provide in anticipation of that enhancement. > >IIRC, there have been comments saying that if the database is on read >only media (eg: CD-ROM), then the database IS actually opened read only, >this would require you to check the attributes of the DB file. >Regards >P. > >--------------------------------------------------------------------- >To unsubscribe, e-mail: [EMAIL PROTECTED] >For additional commands, e-mail: [EMAIL PROTECTED] > > > --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

