[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 216
  • Last Modified:

I need an easy Database for my Windows Service

Hello,

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.
username@imap.provider.com-00001423.msg containing the email
username@imap.provider.com-00001423.inf containing infos about the mail and the handling
username@imap.provider.com-00001444.msg
username@imap.provider.com-00001444.inf
username@imap.provider.com-00001469.msg
username@imap.provider.com-00001469.inf

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.
[Download]
637107880=20090420
637107881=20090420
637107882=20090420
637107885=20090420

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.

- MySQL
- MDB

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?

Stefan
0
StefanKittel
Asked:
StefanKittel
  • 2
1 Solution
 
alb66Commented:
>>>> I cannot tell somebody to buy a MS SQL Server.
Did you try SQL server express edition?
http://www.microsoft.com/express/sql/download/
0
 
AndyAinscowCommented:
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)
0
 
StefanKittelAuthor Commented:
Hello,

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.

Stefan
0
 
AndyAinscowCommented:
The Jet engine exposes a CompactDatabase method
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now