27 May 2002

This software is not supported in any way whatsoever.  You are free to use it as you see fit, however, no claims are made to its suitability for your purposes, nor is it warranted in any way.

I am not claiming that Simple Database is a replacement for a "real" database system.  I use it when a relational database such as Microsoft Access is more than I need.  I would not even attempt to bring this on par with that type of system.  However, for a project where you simply need a way to store information and do not need the functionality that a more robust database provides, then this application is the perfect tool for the job.

I've used this file handling system for the following types of files:

* Tip/Quote of the Day
* SQL definitions file rather than using stored QueryDefs
* Security files (with better encryption than provided here)
* Airfoil database
* Questions and answers for an application that used various topics to test users.  I.e. multiple choice questions.

There are many other uses for this kind of file.  Any program that you can think of uses some type of binary file for storing data.  Microsoft Access databases, Microsoft Word documents, game data, etc are all stored in variations of this type of file.  Any time you are using a sequential or random access file, this system will probably work better than what you are using now and it is much more flexible.

The code provided will work as is to give you a general idea of what it does.  You can simply change the fields as indicated below, and modify the interface to reflect your changes and you will have a fully functional application in a very short time.

===========================

Notes for using Simple Database in your project:

Everything needed to save, read, reposition, etc. is already in place.  You do not need to change any of that code.

There is support to sort on one field.  You can change the code to sort using a different field or add additional sorting functionality if you need to.  Also note that the ComboBox gets populated with values from one field.  You can use any field you want for this or remove it completely.

I have added code to encrypt string data.  This encryption is weak and is meant only to prevent someone from opening your database in a text editor and viewing the data.  There is no support for changing an encrypted database to an unencrypted database.

===========================

There are 5 modifications you must make to this code when you drop it into your project.  It is not difficult, just follow my lead and you'll have a functional database with little effort.  The changes are all related to the Fields you will use in your application.

Note:  Major areas needing modification are indicated within the code with

	' ***** MODIFY *****

	  code to be modified

	' ***** END MODIFY *****

Some areas may need to be modified that are not indicated as such.  In the frmDatabase form, there are several subs having to do with the listbox for Double_Array_01.  You will need to modify or remove these subs as well.

Code needing modification:

1)  Redefine the User-Defined Type (UDT) fields in the cTable Class to have the fields needed for your app.

2)  Change the Field properties in the cRecord Class to reflect the changes to the UDT defined in the cTable Class.

3)  In the cTable Class, change the Fields in the SetData function to reflect the changes to the cRecord Class.

4)  In the cTable Class, change the Fields in the Record (Property Get) property to reflect the changes to the cRecord Class.

5)  In the form, add the code to populate the controls with the Field values in the GetData function.  Also change the code in the SetData function to set the values of Fields before saving.

===========================

Advantages of using Simple Database:

* Simple project development.  All the hard work is done.  You simply need to define the fields and an interface.
* Small distribution size. No Data controls or libraries need to be distributed.
* Works on any WIN 32 system.
* Fast.
* Small footprint in memory and on disk.

===========================

Disadvantages:

* Supports only one table.
* No security.
* No SQL support.
* Does not support sorting on multiple fields, however, this functionality can be added on a per application basis.
* No BLOB field although you could easily add a string field to point to an image file on disk and load it into an Image control or PictureBox.

===========================

If you find bugs or have suggestions, please e-mail me:

paul@paulkjohnson.com

Thank you for using Simple Database.