Can't repair or remove a corrupted database

When I try to open eM Client it automatically runs DbRepair and ends with: 

 ====================
eM Client database check…
X Checking for corrupted database…   
    main.dat
    Checking for inconsistent data
Database verification and repairing failed

Pressing Cancel leads to trying to start again, which produces the same error. 
I have tried:
* restarting the computer
* uninstalling and re-installing eM Client
* uninstalling and removing all registry entries then re-installing eM Client
* renaming the folder at C:\Users…\AppData\Roaming\em Client

With all of the above, when I then reinstall and run, I get the same error. 

What database is left for it to check? 
I suppose it could be finding other SQLite databases - I’m running a few other programs that use SQLite (Dropbox, Zotero, get_iplayer, python) but I’m reluctant to unlinstall all of these. 

I think this problem started when my SD Card (which houses both the em Client program and data) accidentally popped out while the program was running. 

I’d be pleased to fix this, because I’ve grown to love eM Client. 

David IB

Hi David, using eM Client’s directory on an external drive is not recommended.
However are you able to turn the application on? Are you able to get past the database check tool?

Thank you,
Paul.

Hi Paul

First, I’m amazed that an employee is willing to help with a free product - fantastic service!

Unfortunately, I can’t turn on the application. This is what happens: 
* double-click on MailClient.ext

  • a box appears titled: eM Client database check
  • the box says that verification has failed and gives only one option: cancel
    * Click on Cancel
  • another box appears titled eM Client Application Error
  • when I press Continue, the application starts again and the same happens. 

Here’s a couple of screenshots in case they help (accidentally in reverse order)

I’m utterly mystified by this because I don’t know where it is getting the error from. 
I have
* uninstalled the application
* removed all the registry entries
* renamed the data directories
* re-installed the application in Drive C

And it STILL thinks that it needs to check the database!

David IB

Hi David, did you remove the database from the eM Client’s Roaming folder?
To do this go to your local folder > App Data > Roaming and rename or delete the eM Client folder.
When reopening eM client, a new database should be created allowing you to setup the accounts again.

Hope this helps,
Paul.

Yep. Sorry - should have mentioned that. 
Actually I renamed it as “eM ClientX”

This time, to make absolutely sure, I hunted down every folder or filename including “eM Client” using FileLocator and moved them to a backup drive. 
Then I hunted down every registry entry and deleted them (except for the interminable file-type associations). 
Then I restarted and re-installed and ran
On first run it produced the “eM Client Application Error” and then ran the DbRepair.exe which failed in the same way as before. 

I’ve appended the error reports

BTW
To uninstall I’m using IObit Uninstaller to clear out absolutely everything, and also to do a fairly good sweep of the Registry (though I did also manually check the registry after this). 
When it was uninstalling it found the following in the Registry

  • this makes me wonder if somewhere the system is remembering that I had been using eM Client on drive E
    (It ran there happily for several weeks till the E: SD card  popped out). 
    For all the re-installations I’ve been sticking to Drive C.

eM Client (6.0.20648.0)Windows: Microsoft Windows NT 6.2.9200.0, Framework: 4.0.30319.34003
The following error has occurred:
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()
   at System.Data.SQLite.SQLiteConnection.Open()
   at MailClient.Db.Database.OpenConnection(String fileName)
   at MailClient.Db.Database.PrepareDatabase()
   at MailClient.Db.Database…ctor()
   at MailClient.Db.Database.Initialize()
   at MailClient.Program.Main(String[] args)

" rel=“nofollow” target="_blank">http://emclient.com/ns/report">;

eM Client
6.0.20648.0

false

Microsoft Windows NT 6.2.9200.0
4.0.30319.34003


System.Data.SQLite.SQLiteException
disk I/O error
disk I/O error
System.Data.SQLite




System.Data.SQLite.dll
100663600
System.Data.SQLite
System.Data.SQLite.SQLite3
Prepare


System.Data.SQLite
System.Data.SQLite.SQLiteConnection
cnn


mscorlib
System.String
strSql


System.Data.SQLite
System.Data.SQLite.SQLiteStatement
previous


mscorlib
System.UInt32
timeoutMS


mscorlib
System.String&
strRemain



265
4ac




System.Data.SQLite.dll
100663734
System.Data.SQLite
System.Data.SQLite.SQLiteCommand
BuildNextCommand


f6
17f




System.Data.SQLite.dll
100663735
System.Data.SQLite
System.Data.SQLite.SQLiteCommand
GetStatement


mscorlib
System.Int32
index



8
12




System.Data.SQLite.dll
100663982
System.Data.SQLite
System.Data.SQLite.SQLiteDataReader
NextResult


e4
112




System.Data.SQLite.dll
100663943
System.Data.SQLite
System.Data.SQLite.SQLiteDataReader
.ctor


System.Data.SQLite
System.Data.SQLite.SQLiteCommand
cmd


System.Data
System.Data.CommandBehavior
behave



5d
71




System.Data.SQLite.dll
100663757
System.Data.SQLite
System.Data.SQLite.SQLiteCommand
ExecuteReader


System.Data
System.Data.CommandBehavior
behavior



c
26




System.Data.SQLite.dll
100663760
System.Data.SQLite
System.Data.SQLite.SQLiteCommand
ExecuteNonQuery


6
21




System.Data.SQLite.dll
100663353
System.Data.SQLite
System.Data.SQLite.SQLiteConnection
Open


7d3
10f9




MailClient.exe
100686139
MailClient
MailClient.Db.Database
OpenConnection


mscorlib
System.String
fileName



2d
6e




MailClient.exe
100686142
MailClient
MailClient.Db.Database
PrepareDatabase


10
46




MailClient.exe
100686132
MailClient
MailClient.Db.Database
.ctor


c9
f2




MailClient.exe
100686143
MailClient
MailClient.Db.Database
Initialize


0
26




MailClient.exe
100675672
MailClient
MailClient.Program
Main


mscorlib
System.String[]
args



85f
123e



183




MailClient.exe
C:\Program Files\eM Client\MailClient.exe
MailClient.exe
MailClient.exe
6.0.20648.0
eM Client
eM Client
6.0.20648.0
False
False
False
False
False
Language Neutral


ntdll.dll
C:\Windows\SYSTEM32\ntdll.dll
ntdll.dll
ntdll.dll.mui
6.3.9600.16384 (winblue_rtm.130821-1623)
NT Layer DLL
Microsoft® Windows® Operating System
6.3.9600.16384
False
False
False
False
False
English (United States)


MSCOREE.DLL
C:\Windows\SYSTEM32\MSCOREE.DLL
mscoree.dll
mscoree.dll
6.3.9600.16384 (winblue_rtm.130821-1623)
Microsoft .NET Runtime Execution Engine
Microsoft® Windows® Operating System
6.3.9600.16384
False
False
False
False
False
English (United States)


KERNEL32.dll
C:\Windows\system32\KERNEL32.dll
kernel32
kernel32
6.3.9600.16384 (winblue_rtm.130821-1623)
Windows NT BASE API Client DLL
Microsoft® Windows® Operating System
6.3.9600.16384
False
False
False
False
False
English (United States)


KERNELBASE.dll
C:\Windows\system32\KERNELBASE.dll
Kernelbase.dll
Kernelbase.dll.mui
6.3.9600.16384 (winblue_rtm.130821-1623)
Windows NT BASE API Client DLL
Microsoft® Windows® Operating System
6.3.9600.16384
False
False
False
False
False
English (United States)


ADVAPI32.dll
C:\Windows\system32\ADVAPI32.dll
advapi32.dll
advapi32.dll.mui
6.3.9600.16384 (winblue_rtm.130821-1623)
Advanced Windows 32 Base API
Microsoft® Windows® Operating System
6.3.9600.16384
False
False
False
False
False
English (United States)


msvcrt.dll
C:\Windows\system32\msvcrt.dll
msvcrt.dll
msvcrt.dll
7.0.9600.16384 (winblue_rtm.130821-1623)
Windows NT CRT DLL
Microsoft® Windows® Operating System
7.0.9600.16384
False
False
False
False
False
English (United States)


sechost.dll
C:\Windows\SYSTEM32\sechost.dll
sechost.dll
sechost.dll.mui
6.3.9600.16384 (winblue_rtm.130821-1623)
Host for SCM/SDDL/LSA Lookup APIs
Microsoft® Windows® Operating System
6.3.9600.16384
False
False
False
False
False
English (United States)


RPCRT4.dll
C:\Windows\system32\RPCRT4.dll
rpcrt4.dll
rpcrt4.dll.mui
6.3.9600.16384 (winblue_rtm.130821-1623)
Remote Procedure Call Runtime
Microsoft® Windows® Operating System
6.3.9600.16384
False
False
False
False
False
English (United States)


mscoreei.dll
C:\Windows\Microsoft.NET\Framework\v4.0.30319\mscoreei.dll
mscoreei.dll
mscoreei.dll
4.0.30319.33440 built by: FX45W81RTMREL
Microsoft .NET Runtime Execution Engine
Microsoft® .NET Framework
4.0.30319.33440
False
False
False
True
False
English (United States)


SHLWAPI.dll
C:\Windows\system32\SHLWAPI.dll
SHLWAPI
SHLWAPI.DLL.MUI
6.3.9600.16384 (winblue_rtm.130821-1623)
Shell Light-weight Utility Library
Microsoft® Windows® Operating System
6.3.9600.16384
False
False
False
False
False
English (United States)


combase.dll
C:\Windows\SYSTEM32\combase.dll
COMBASE.DLL
COMBASE.DLL.MUI
6.3.9600.16384 (winblue_rtm.130821-1623)
Microsoft COM for Windows
Microsoft® Windows® Operating System
6.3.9600.16384
False
False
False
False
False
English (United States)


USER32.dll
C:\Windows\system32\USER32.dll
user32
user32
6.3.9600.16384 (winblue_rtm.130821-1623)
Multi-User Windows USER API Client DLL
Microsoft® Windows® Operating System
6.3.9600.16384
False
False
False
False
False
English (United States)


GDI32.dll
C:\Windows\system32\GDI32.dll
gdi32
gdi32
6.3.9600.16421 (winblue_gdr.131004-2100)
GDI Client DLL
Microsoft® Windows® Operating System
6.3.9600.16421
False
False
False
False
False
English (United States)


IMM32.DLL
C:\Windows\system32\IMM32.DLL
imm32
imm32
6.3.9600.16384 (winblue_rtm.130821-1623)
Multi-User Windows IMM32 API Client DLL
Microsoft® Windows® Operating System
6.3.9600.16384
False
False
False
False
False
English (United States)


MSCTF.dll
C:\Windows\system32\MSCTF.dll
MSCTF
MSCTF.DLL.MUI
6.3.9600.16384 (winblue_rtm.130821-1623)
MSCTF Server DLL
Microsoft® Windows® Operating System
6.3.9600.16384
False
False
False
False
False
English (United States)


clr.dll
C:\Windows\Microsoft.NET\Framework\v4.0.30319\clr.dll
clr.dll
clr.dll
4.0.30319.34003 built by: FX45W81RTMGDR
Microsoft .NET Runtime Common Language Runtime - WorkStation
Microsoft® .NET Framework
4.0.30319.34003
False
False
False
True
False
English (United States)


MSVCR120_CLR0400.dll
C:\Windows\SYSTEM32\MSVCR120_CLR0400.dll
msvcr120_clr0400.dll
msvcr120_clr0400.dll
12.00.20806.33440 built by: FX45W81RTMREL
Microsoft® C Runtime Library
Microsoft® Visual Studio® 12 CTP
12.00.20806.33440
False
False
False
False
False
English (United States)


mscorlib.ni.dll
C:\Windows\assembly\NativeImages_v4.0.30319_32\mscorlib\f53cfbc3ae73aedfcdab4e4cfe531a4b\mscorlib.ni.dll
mscorlib.dll
mscorlib.dll
4.0.30319.34003 built by: FX45W81RTMGDR
Microsoft Common Language Runtime Class Library
Microsoft® .NET Framework
4.0.30319.34003
False
False
False
True
False
English (United States)


ole32.dll
C:\Windows\system32\ole32.dll
OLE32.DLL
OLE32.DLL.MUI
6.3.9600.16384 (winblue_rtm.130821-1623)
Microsoft OLE for Windows
Microsoft® Windows® Operating System
6.3.9600.16384
False
False
False
False
False
English (United States)


kernel.appcore.dll
C:\Windows\SYSTEM32\kernel.appcore.dll
kernel.appcore.dll
kernel.appcore.dll
6.3.9600.16384 (winblue_rtm.130821-1623)
AppModel API Host
Microsoft® Windows® Operating System
6.3.9600.16384
False
False
False
False
False
English (United States)


CRYPTBASE.dll
C:\Windows\SYSTEM32\CRYPTBASE.dll
cryptbase.dll
cryptbase.dll
6.3.9600.16384 (winblue_rtm.130821-1623)
Base cryptographic API DLL
Microsoft® Windows® Operating System
6.3.9600.16384
False
False
False
False
False
English (United States)


bcryptPrimitives.dll
C:\Windows\SYSTEM32\bcryptPrimitives.dll
bcryptprimitives.dll
bcryptprimitives.dll
6.3.9600.16384 (winblue_rtm.130821-1623)
Windows Cryptographic Primitives Library
Microsoft® Windows® Operating System
6.3.9600.16384
False
False
False
False
False
English (United States)


uxtheme.dll
C:\Windows\system32\uxtheme.dll
UxTheme.dll
UxTheme.dll.mui
6.3.9600.16384 (winblue_rtm.130821-1623)
Microsoft UxTheme Library
Microsoft® Windows® Operating System
6.3.9600.16384
False
False
False
False
False
English (United States)


tiptsf.dll
C:\Program Files\Common Files\microsoft shared\ink\tiptsf.dll
TipTsf.dll
TipTsf.dll.mui
6.3.9600.16384 (winblue_rtm.130821-1623)
Touch Keyboard and Handwriting Panel Text Services Framework
Microsoft® Windows® Operating System
6.3.9600.16384
False
False
False
False
False
English (United States)


OLEAUT32.dll
C:\Windows\system32\OLEAUT32.dll
OLEAUT32.DLL

6.3.9600.16384


6.3.9600.16384
False
False
False
False
False
English (United States)


System.ni.dll
C:\Windows\assembly\NativeImages_v4.0.30319_32\System\7fb8b50f254a60f46417d8698735943a\System.ni.dll
System.dll
System.dll
4.0.30319.34003 built by: FX45W81RTMGDR
.NET Framework
Microsoft® .NET Framework
4.0.30319.34003
False
False
False
True
False
English (United States)


CRYPTSP.dll
C:\Windows\SYSTEM32\CRYPTSP.dll
cryptsp.dll
cryptsp.dll
6.3.9600.16384 (winblue_rtm.130821-1623)
Cryptographic Service Provider API
Microsoft® Windows® Operating System
6.3.9600.16384
False
False
False
False
False
English (United States)


rsaenh.dll
C:\Windows\system32\rsaenh.dll
rsaenh.dll
rsaenh.dll.mui
6.3.9600.16384 (winblue_rtm.130821-1623)
Microsoft Enhanced Cryptographic Provider
Microsoft® Windows® Operating System
6.3.9600.16384
False
False
False
False
False
English (United States)


bcrypt.dll
C:\Windows\SYSTEM32\bcrypt.dll
bcrypt.dll
bcrypt.dll.mui
6.3.9600.16384 (winblue_rtm.130821-1623)
Windows Cryptographic Primitives Library
Microsoft® Windows® Operating System
6.3.9600.16384
False
False
False
False
False
English (United States)


MailClient.Collections.ni.dll
C:\Windows\assembly\NativeImages_v4.0.30319_32\MailClient.1d52ed9e#\3853e4b635a67ce51cf561b38c4c1f48\MailClient.Collections.ni.dll
MailClient.Collections.dll
MailClient.Collections.dll
6.0.20648.0
MailClient.Collections
MailClient.Collections
6.0.20648.0
False
False
False
False
False
Language Neutral


MailClient.Mail.ni.dll
C:\Windows\assembly\NativeImages_v4.0.30319_32\MailClient.Mail\7e70ce44433edcc81fd2b55714c6b3c8\MailClient.Mail.ni.dll
MailClient.Mail.dll
MailClient.Mail.dll
6.0.20648.0


6.0.20648.0
False
False
False
False
False
Language Neutral


HTMLEditorControl.ni.dll
C:\Windows\assembly\NativeImages_v4.0.30319_32\HTMLEditorControl\36bd754e4d10881c02500e1e9442b9b7\HTMLEditorControl.ni.dll
HTMLEditorControl.dll
HTMLEditorControl.dll
6.0.20648.0
HtmlEditorControl

6.0.20648.0
False
False
False
False
False
Language Neutral


MailClient.ni.exe
C:\Windows\assembly\NativeImages_v4.0.30319_32\MailClient\cba5208b273cbed38de40666f7a08a4c\MailClient.ni.exe
MailClient.exe
MailClient.exe
6.0.20648.0
eM Client
eM Client
6.0.20648.0
False
False
False
False
False
Language Neutral


System.Drawing.ni.dll
C:\Windows\assembly\NativeImages_v4.0.30319_32\System.Drawing\7fc996267c8fdbf5f4a99648b2b4a764\System.Drawing.ni.dll
System.Drawing.dll
System.Drawing.dll
4.0.30319.33440 built by: FX45W81RTMREL
.NET Framework
Microsoft® .NET Framework
4.0.30319.33440
False
False
False
True
False
English (United States)


System.Windows.Forms.ni.dll
C:\Windows\assembly\NativeImages_v4.0.30319_32\System.Windows.Forms\5bfb986816df97dad53f0f8805034c13\System.Windows.Forms.ni.dll
System.Windows.Forms.dll
System.Windows.Forms.dll
4.0.30319.33440 built by: FX45W81RTMREL
.NET Framework
Microsoft® .NET Framework
4.0.30319.33440
False
False
False
True
False
English (United States)


MailClient.Interop.ni.dll
C:\Windows\assembly\NativeImages_v4.0.30319_32\MailClient.Interop\a2c4d24e561063796f68b04c1c16b82d\MailClient.Interop.ni.dll
MailClient.Interop.dll
MailClient.Interop.dll
6.0.20648.0


6.0.20648.0
False
False
False
False
False
Language Neutral


MailClient.ExceptionUtils.ni.dll
C:\Windows\assembly\NativeImages_v4.0.30319_32\MailClient.ad6c0f7b#\574fb25e99a78faf254e15ea2076912f\MailClient.ExceptionUtils.ni.dll
MailClient.ExceptionUtils.dll
MailClient.ExceptionUtils.dll
1.0.0.0
MailClient.ExceptionUtils
MailClient.ExceptionUtils
1.0.0.0
False
False
False
False

That error code   (0x80004005) used to signify ‘Access Denied’ - anti virus maybe?

Hi David, this is not good, it’s not recommended to perform such actions as delete the registry files etc.
Can you please uninstall the application in program uninstaller (without using the unistallation application). After you remove the application from the system go to your local folder > App Data > Roaming, and delete the eM Client folder.

Try to install this version of eM Client after you finish the database removal (eM Client folder).
http://www.emclient.com/dist/v6.0.20715/setup.msi

Although the error you’re now seeing can also be related to hard drive issues (Disk I/O error).

Hope this helps,
Paul.

Thank you for sending a link to the newest installation file. 
That was the only thing I hadn’t tried. 

I did an uninstall, delted the Roaming folder and used this newest install and (as usual) 
the program opened with an error box and tried to check main.dat - which fails. 

I agree with you that one should not normally touch the Registry. I did this after many failed cycles of uninstalling, restarting and reinstalling. 

I started by using the normal uninstall
and then uninstall + deleting the Roaming folder 
and then uninstall + deleting the Roaming folder + registry entries
and then moving all backup folders off the computer then trying again

But every time I re-installed, the program finds a faulty main.dat
I can’t think where it is finding this!

Ah…
I’ve just spotted something which may help - or may deepen the mystery. 

There is a copy of the Roaming/eM Client on the E: drive. 
When I delete this, and run MailClient.exe, this is created again.
When I move it to C:/…Roaming it is still re-created in E:/…Roaming when I run MailClient.exe

Where is the information used by MailClient.exe telling it where to create the Roaming folder? 

BTW, as I said previously, I had been running em Client successfully on Drive E for many weeks. 
The eM Client installer does not ask where to install it, and only installs in C: 
So I used AppMover to move the files and change the registry entries and this worked well. 
But clearly something is confused somewhere. 

I need to run eM Client in a different drive because my C: drive is very limited (I’m using an Asus Transformer - T100, which has a built-in 8G C: drive). 

Hi David, please move the eM Client directory using the standard way, there’s an option for this in Tools > Settings > General > Storage.
This should prevent you from having these issue, you can setup the directory folder there and eM Client will create a new database in the desired destination.

Using 3rd party apps for this can result with these issues.

Thank you for understanding,
Paul.

Thanks for reminding me about this setting. 
I think I used AppMover because I wanted to move the program files as well as the data. 

At present I can’t start up the program, so it is difficult to change this. 
So I guess you are saying: You got yourself into this mess, and you are beyond our help. 

Do you happen to know where MailClient.exe finds the information telling it where to create the Roaming folder?
Even after a clean reinstall, it still creates a new Roaming folder on E:

Hi David, I was not trying to suggest this is an issue left for you to resolve, but unfortunately it was caused by non-standard interference into the internal files.
I’ve submitted this issue to the developers for a possible solution or a way out of this loop, but it might take a while before they reply.

One possible scenario you could try is to uninstall the application (make sure it’s supposed to be uninstalled).
Then you can try to run the application install through ‘Run’ with this criteria:

msiexec /i setup.msi
MAILCLIENTINSTALLLOCATION=

This will install eM Client onto another location, also make sure the eM Client directory from your Roaming folder is deleted.

Regards,
Paul.

Thanks - that’s really helpful !
I had a go at doing that. It installed successfully in E,
though the same error occured when installed there.

Thanks for asking the development guys to look at this.