I've been using a SQLite database for a few weeks. Today, it suddenly stopped working. The database has a single table, and can correctly report that:

 select name, sql from sqlite_master

|name                                     |sql
|-----------------------------------------|-----------------------------|
|tMessages                                |CREATE TABLE tMessages(fMs...|
|-----------------------------------------|-----------------------------|
1 record.

But pretty much any other command reports an error.  For example:

 select count(*) from tMessages
Error: SQL logic error or missing database

 select fMsgID from tMessages where fMsgID='jjstrout06011-3228733882.560'
Error: SQL logic error or missing database

Furthermore, a VACUUM command produces a different error:

 vacuum
Error: database disk image is malformed

So clearly my database is corrupted. My two questions (three questions!) are, how can this happen? Is there any way to prevent it? And is there any way to recover my data once I'm in this state?

Thanks,
- Joe

--

Joseph J. Strout
[EMAIL PROTECTED]

Reply via email to