Assume I have a database which is "malformed" due to rowid xxx missing from a 
table index. In the System.Data.SQLite.dll C# driver the following 
code would return the reason, I would get a list of the rowid problems allowing 
me to log them.

        private static IEnumerable<string> IntegrityCheck(SQLiteConnection 
            using (var command = new SQLiteCommand(connection))
                command.CommandTimeout = 0;
                command.CommandText = "pragma integrity_check";

                using (var reader = command.ExecuteReader())
                    while (reader.Read())
                        yield return reader.GetString(0);

However using a later driver such as the ExecuteReader() call throws 
an exception saying the database is malformed. That is not very helpful and 
stops me running the integrity check. If I replace the integrity_check with 
quick_check it works and returns ok, so access to the file is ok, just some 
internal indexes are messed up. Is there any way to get the above working in 
the later drivers?

Kind Regards,
Fugro Intersite.

Barry Roberts.
b.robe...@fugro.com<mailto:b.robe...@fugro.com> | www.fugro.com

sqlite-users mailing list

Reply via email to