Connect to MSSQL

This page describes how to connect to the hMailServer MSSQL database to execute statements.

Step 1: Determine MSSQL password

If you are using an external version of MSSQL, you should already know your MSSQL password. If you are using the built-in MSSQL version that comes with hMailServer, you might not know your password. To determine it, follow these steps:

  1. Open up hMailserver.ini, located in your Windows directory.
  2. If you can't find passwordencryption=1 in the file, locate the password in the file and go to Step 2: Connect to the server below.
  3. Run the script \hMailServer\Addons\Utilities\DecryptBlowfish.vbs.
  4. Copy the password from hMailServer.ini to the DecryptBlowfish dialog.
  5. Click OK in DecryptBlowfish to view your password. DecryptBlowfish will now show your password. Either keep the dialog open or memorize the password.

Step 2: Install required software

To be able to connect to the Microsoft SQL Server Compact database, you need Microsoft SQL Server 2008 Studio Express. The following software needs to be installed for Microsoft SQL Server 2008 Studio Express.

After these tools have been installed, you can install Microsoft SQL Server 2008 Studio Express. During the installation, make sure you select to install the Management Tools.

Step 3: Connect to the server

  1. Start SQL Server Management Studio found in the start menu.
  2. Select File -> Connect Object Explorer
  3. Select SQL Server Compact Edition from the Server type list.
  4. Select the hMailServer database file, typically C:\Program Files\hMailServer\Database\hMailServer.sdf
  5. Type in the password you retrieved in step 1
  6. Click Connect to connect to the database server

Now you have connected to MSSQL

Step 3: Executing statements

After you have connected to MSSQL, you can execute statements by following these steps:

  1. In the tree-menu to the left, right click on the hmailserver database.
  2. Select New Query from the context menu.


Search documentation