Click here to Skip to main content
13,048,406 members (95,721 online)
Click here to Skip to main content
Add your own
alternative version


20 bookmarked
Posted 11 Sep 2002

TwinXBase service

, 11 Sep 2002
Rate this:
Please Sign up or sign in to vote.
A service that scans for DBX files and adds their contents to a main Access database
<!-- Download Links -->

How it works:

This service scans in a directory (C:\FILESERVICE\INBOX) by using the .NET  FileWatcher component  (not really scans - it just checks for created files)

when a file is created the service will check the extension of the file. If the file has the extension .DBX then it will read the contents of the file and communicate with the database (C:\FILESERVICE\DB\MyDB.mdb) and insert / update / delete the records in the database. Then the file will be moved to the subdirectory \BACKUP. When an error occurs the error will be logged in the EventLog.

If an other file other than a DBX arrives in the inbox it will be moved  to the subdir \UNKNOWN.

If you look at the code, you can easy make the service to use with other kind of files. and you can make an application (class) that handle those files.

Example extension

Mail could be used to send mails by using my code in "C# mail console" so when you share the C:\FILESERVICE\Inbox for FTP , the service will handle the incoming files...

First run

If the service is running then the first time it will check if the directory's exists on the C:\ drive. if not, it will be created. The directory's are:


In the zip file you can find 2 examples for database use, called USERS.DBX and ARTICLES.DBX If you want to view those files open it with notepad. the records are comma separated.

Next you have to do is copy the Access dababase file included in the zip file and copy it to the C:\FILESERVICE\DB directory.

Then you can put a example of the file .DBX in the inbox dir, and the service will handle the file. Open then the database file and check the records that are inserted/updated / deleted.

Installing the service

First compile the application so you will have an executable (exe). For the Visual Studio users, go to Start -> Microsoft VS.NET -> VS.NET Tools -> VS.NET Command Prompt. You will see a command box (console) then go to the directory where the exe is. then in that directory type

InstallUtil MyFileService.exe 

This will install the service Once it correctly installed you can start the service by typing


Or you can go to Services in Configuration, look for the new service, start it. To Remove the service, stop the service and type

InstallUtil /u MyFileService.exe


This is just a small example.. I will try to make the service later for reading XML files for database use and others. But now you have an idea howto create a service and more..



This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here


About the Author

Web Developer
Belgium Belgium
Education :
- Graduate Electronics
- Graduate Informatics

- VB6
- Delphi
- C/C++
- C# (basics)

- Application Developper in Retail Firme,
developping Point Of Sale Apps.
(Front and Backstore)

You may also be interested in...


Comments and Discussions

QuestionWhat's the meaning? Pin
Uwe Keim16-Sep-02 19:59
sitebuilderUwe Keim16-Sep-02 19:59 
AnswerRe: What's the meaning? Pin
Joe Billy26-Jul-03 3:22
memberJoe Billy26-Jul-03 3:22 
AnswerRe: What's the meaning? Pin
mstallmann10-Sep-03 5:10
membermstallmann10-Sep-03 5:10 
QuestionRe: What's the meaning? Pin
winni7825-Jan-06 9:52
memberwinni7825-Jan-06 9:52 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

Permalink | Advertise | Privacy | Terms of Use | Mobile
Web02 | 2.8.170713.1 | Last Updated 12 Sep 2002
Article Copyright 2002 by Petervu
Everything else Copyright © CodeProject, 1999-2017
Layout: fixed | fluid