Corrupted Database

Upgraded to the latest version of eM Client - now get a corrupted database error when I try to load:

System.Data.SQLite.SQLiteException (0x80004005): disk I/O error
disk I/O error
   at System.Data.SQLite.SQLite3.Prepare(SQLiteConnection cnn, String strSql, SQLiteStatement previous, UInt32 timeoutMS, String& strRemain)
   at System.Data.SQLite.SQLiteCommand.BuildNextCommand()
   at System.Data.SQLite.SQLiteCommand.GetStatement(Int32 index)
   at System.Data.SQLite.SQLiteDataReader.NextResult()
   at System.Data.SQLite.SQLiteDataReader…ctor(SQLiteCommand cmd, CommandBehavior behave)
   at System.Data.SQLite.SQLiteCommand.ExecuteReader(CommandBehavior behavior)
   at System.Data.SQLite.SQLiteCommand.ExecuteNonQuery(CommandBehavior behavior)
   at System.Data.SQLite.SQLiteCommand.ExecuteNonQuery()
   at System.Data.SQLite.SQLiteConnection.Open()
   at MailClient.Storage.Data.DataStore.GetConnectionInternal(String relativeName)
   at DbRepair.CorruptionChecker.CheckCorruption(RepairOptions repairOptions, CancellationToken token)
   at DbRepair.CheckingProcess.Check(CancellationToken token)
Data:
SQLiteCommandText: PRAGMA synchronous=Normal
databaseFile: folders.dat

Trying to restore backup gets me : 
System.IO.IOException: Access to the path ‘C:\Users\Lorna\AppData\Roaming\eM Client’ is denied.
   at System.IO.Directory.InternalMove(String sourceDirName, String destDirName, Boolean checkHost)
   at DbBackup.FormBackup.Restore(String backupFile, CancellationToken cancellationToken)
   at DbBackup.FormBackup.Restore(CancellationToken cancellationToken)
   at DbBackup.FormBackup.<mainform_load>b__27_0(Object a, DoWorkEventArgs b)
at System.ComponentModel.BackgroundWorker.OnDoWork(DoWorkEventArgs e)
at System.ComponentModel.BackgroundWorker.WorkerThreadStart(Object argument)</mainform_load>

FIXED IT!

Somehow my .NET Framework had become corrupted, fixed that and I got it working again. I’d lost about six months of emails, but it wasn’t hard to get those back from GMail.

So if you run into similar problems, Microsoft has a small program that will help you fix the problem : https://www.microsoft.com/en-ca/download/details.aspx?id=30135  

Worked for me too. Still have a malformed image, but at least emclient starts

The best solution is to delete the database and start again. If you are setup as IMAP your emails will be online, so you will not lose anything. If you are using POP3, or have any local data like local email folders, contacts or calendars, you want to export those first.

Close eM Client and delete or rename the C:\Users_username_\AppData\Roaming\eM Client folder. When you restart eM Client you will be prompted to setup your account. Do that, then import any exported data. 

You should no longer have a malformed database.