Remote access to mobile databases
Home | Products | Buy | Support | Downloads | Contacts | Forum | Blog Search

open all | close all

If you are using Windows Mobile 5, then this article is not for you. WM5 makes it a breeze to install any application - even the SQL CE engines - in your devices's storage card, which is the ideal solution if, like me, you must have both engines installed side-by-side.

Windows Mobile 2003 is a different story. The CAB files distributed by Microsoft do not give you an option to specify the target location of the engine, so one usually ends up consuming precious RAM.

So, how can you install these big database engines in a storage card? First, start by installing them to memory. Second, grab a COM DLL register utility such as this one. Third, find a good registry editor (the remote registry editor in eVC will do just fine). Fourth, select your target storage card and create two directories ath the root: Program Files and Windows.

Open your registry editor and locate the HKEY_LOCAL_MACHINE\Loader key where you will find an entry named SystemPath. This is a multi-sz value that contains the DLL search path for your device. Typically you should only have a \Release\ string there. You need to add another with your storage card's Windows directory. For the sake of discussion, I will use my own case: \CF Card\Windows\, so the value should look like this:

\Release\
\CF Card\Windows\

Now read on.

Moving SQL CE 2.0 to Storage

The SQL CE 2.0 engine is generally installed in the device's \Windows\SQLCE 2.0 directory. Start by unregistering the ssceca20.dll and ssce20.dll files (SQL CE 2.0 will not work now). Now, move this directory to the storage card's own Windows directory. You now should have a new directory:

\CF Card\Windows\SQLCE 2.0

Now, go back and register the ssceca20.dll and ssce20.dll files. SQL CE 2.0 is now fully operational again. There are a few more bits to attend to.

First, go to the device's \Windows\Start Menu\Programs directory and delete the existing Query Analyzer link: it no longer works. You can easily create a new one by copying the

\CF Card\Windows\SQLCE 2.0\isqlw20.exe

and pasting it there as a shortcut. Rename it to its old name.

Next, open the registry editor and look for the following keys:

HKEY_LOCAL_MACHINE\SOFTWARE\Apps\Microsoft SQLCE 2.0
HKEY_LOCAL_MACHINE\SOFTWARE\Apps\Microsoft SQLCE 2.0 Dev

Search for the entries named InstlDir and InstallDir and replace the value

\Windows\SQLCE 2.0

with:

\CF Card\Windows\SQLCE 2.0

You are done.

Moving SQL Mobile to Storage

The SQL Mobile is not installed in its own subdirectory under Windows - all DLL files are in the \Windows directory but they are easily recognizable: all start with sqlce and end with 30.

If you are using the OLE DB provider, unregister sqlceoledb30.dll before copying all DLL files to \CF Card\Windows. After copying, don't forget to register this DLL again.

The rest of the process is similar to SQL CE 2.0's, but with one addition. If you also move the isqlw30.exe file from:

\Program Files\SQL Mobile\EN

to:

\CF Card\Program Files\SQL Mobile\EN

besides recreating the Program Files link, you will also have to correct the entries in:

HKEY_CLASSES_ROOT\sdffile\DefaultIcon
HKEY_CLASSES_ROOT\sdffile\Shell\Open\Command

Note: this also applies to SQL CE 2.0 but, if you have a side-by-side install you have to choose only one of the isqlw files to put here.

And that's it!