Solved

Creating a c++ database program

Posted on 1998-03-01
2
1,480 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Templates For Beginners Or How To Encourage The Compiler To Work For You Introduction This tutorial is targeted at the reader who is, perhaps, familiar with the basics of C++ but would prefer a little slower introduction to the more ad…
Go is an acronym of golang, is a programming language developed Google in 2007. Go is a new language that is mostly in the C family, with significant input from Pascal/Modula/Oberon family. Hence Go arisen as low-level language with fast compilation…
The viewer will learn additional member functions of the vector class. Specifically, the capacity and swap member functions will be introduced.
The viewer will be introduced to the member functions push_back and pop_back of the vector class. The video will teach the difference between the two as well as how to use each one along with its functionality.

911 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

16 Experts available now in Live!

Get 1:1 Help Now