Solved

Creating a c++ database program

Posted on 1998-03-01
2
1,484 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Technology Partners: 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!

Question has a verified solution.

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

  Included as part of the C++ Standard Template Library (STL) is a collection of generic containers. Each of these containers serves a different purpose and has different pros and cons. It is often difficult to decide which container to use and …
Many modern programming languages support the concept of a property -- a class member that combines characteristics of both a data member and a method.  These are sometimes called "smart fields" because you can add logic that is applied automaticall…
The viewer will learn how to pass data into a function in C++. This is one step further in using functions. Instead of only printing text onto the console, the function will be able to perform calculations with argumentents given by the user.
The viewer will learn how to clear a vector as well as how to detect empty vectors in C++.

732 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