Solved

Creating a c++ database program

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

On Demand Webinar: Networking for the Cloud Era

Ready to improve network connectivity? Watch this webinar to learn how SD-WANs and a one-click instant connect tool can boost provisions, deployment, and management of your cloud connection.

Question has a verified solution.

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

Written by John Humphreys C++ Threading and the POSIX Library This article will cover the basic information that you need to know in order to make use of the POSIX threading library available for C and C++ on UNIX and most Linux systems.   [s…
Introduction This article is the first in a series of articles about the C/C++ Visual Studio Express debugger.  It provides a quick start guide in using the debugger. Part 2 focuses on additional topics in breakpoints.  Lastly, Part 3 focuses on th…
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 additional member functions of the vector class. Specifically, the capacity and swap member functions will be introduced.

717 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