I need an easy Database for my Windows Service

Posted on 2009-04-19
Last Modified: 2013-11-20

I have a small service which downloads mails, stores them and sends them (IMAP 2 SMTP).
These functions are from my first tests. Fast and dirty. But now I want to design them at all.

I need them to be stored in some kind of files. So the user can move them to an other machine easy.

So I have a email-account with about 3500 mails. Each 20-100k in size.

I download them to the local dir and create two files for each mail. containing the email containing infos about the mail and the handling

I need to delete the mails after 14 days. So I need to know which ones I allready downloaded, which not and which to delete.
For this I use a ini-file.

This file is about 300-400k in size.
Im not sure how clever GetPrivateProfileString or WritePrivateProfileString are.

I have a log file with about 30 - 100 MB per day (textfile).

Old Information will be deleted to save space.

So here we go.

a) how should I save the emails itself?
Everybody told me not to save binary data in a mailbox. But a dir with thousend of small files sounds not very good too.

b) which kind of database to use to stores the other information?

It must be:

- free of chargeto use in a comercial software
- easy to install
- capabil to defrag itself

Because the software will only costs about 50 Euro I cannot tell somebody to buy a MS SQL Server.
Allthough I cannot tell anybody to install MySQL itself.


But how to defrag. I tried to programmly defrag mdb files without success.
Is this possible with mysql?

How to access MySQL from a service?

Question by:StefanKittel
    LVL 19

    Expert Comment

    >>>> I cannot tell somebody to buy a MS SQL Server.
    Did you try SQL server express edition?
    LVL 43

    Expert Comment

    You could also consider a microsoft access database.  (Chances are you wouldn't need to even install anything - the ADO components you would require are parts of the operating system)
    LVL 4

    Author Comment


    a MySQL ofr MS SQL Server is a little bit heavy and could lead to many technical problem during installation I need to handle.

    Acces sounds find. But how to shrink it? I delete often data so I need to shrink this file.
    I could not find using google.

    LVL 43

    Accepted Solution

    The Jet engine exposes a CompactDatabase method

    Featured Post

    Top 6 Sources for Identifying Threat Actor TTPs

    Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

    Join & Write a Comment

    Introduction: Finishing the grid – keyboard support for arrow keys to manoeuvre, entering the numbers.  The PreTranslateMessage function is to be used to intercept and respond to keyboard events. Continuing from the fourth article about sudoku. …
    Introduction: Hints for the grid button.  Nested classes, templated collections.  Squash that darned bug! Continuing from the sixth article about sudoku.   Open the project in visual studio. First we will finish with the SUD_SETVALUE messa…
    This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
    Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…

    733 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    24 Experts available now in Live!

    Get 1:1 Help Now