Solved

Creating a c++ database program

Posted on 1998-03-01
2
1,478 Views
Last Modified: 2008-02-01
I need to make a database program that doesn't rely on other DB engines like msjet so it can run on different platforms. It will mainly run on windows OSs. Is there any samples or if need be books on DB engine or algorithm
that manages its own file reading and writing to it the data entered and storing it in its own file. The file will just store text information. One question that i been wondering is if the program deletes an entry in the DB file will there be a "whole" there so the pogram has to shift all entries after the one deleted up one to fill it in so a file read next time  won't prompt an error in the file like corrupt. It seems DB files use one file and then add more data to it when creating a new record under that DB if so wouldn't the file get to big after a while. I came up with an idea that for the
DB file it would just be a directory and the "table" would be another directory in the DB directory. Under each table
will be individual files for each record that has the actual data. The header of the file will contain fields data that says how many fields and how far each field entry will be when reading out the file. Does this sound reasonable?
0
Comment
Question by:trc170
2 Comments
 
LVL 6

Accepted Solution

by:
jpk041897 earned 0 total points
ID: 1182902
Thats one possib way of doing it, I would suggest you build a B Ttrieve sructure, or even better a B+trieve or CTrieve structure.

In this fashion, you can reutilize all the space in a fixed record length DB or most space in a variable record lengthDB.

I would further suggest that you either search the shareware pages for said algoritm, or you coud purchase te C Database Toolchest (orsimilar product) from:

http://www.mixsoftware.com/product/database.htm

If you opt for this product (hich I found verry well written) and  which dos everyting you want alleady, you would only nee to write a C++ wrapper arround their C API. Consideng the product sell for less tan US $50.00, I would believe it migt be a good bet.
0
 

Author Comment

by:trc170
ID: 1182903
Thanks jpk you are the few i run across that can answer my questions.
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Often, when implementing a feature, you won't know how certain events should be handled at the point where they occur and you'd rather defer to the user of your function or class. For example, a XML parser will extract a tag from the source code, wh…
Introduction This article is a continuation of the C/C++ Visual Studio Express debugger series. Part 1 provided a quick start guide in using the debugger. Part 2 focused on additional topics in breakpoints. As your assignments become a little more …
The goal of the video will be to teach the user the difference and consequence of passing data by value vs passing data by reference in C++. An example of passing data by value as well as an example of passing data by reference will be be given. Bot…
The viewer will learn how to clear a vector as well as how to detect empty vectors in C++.

758 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

22 Experts available now in Live!

Get 1:1 Help Now