For most database programming, the QL programmer has been pretty much stuck with Archive. Archive is a fine language and is fairly similar to dBase III in programming feel. It has many advantages: editing of records built in, easy screen creation, a well structured language. But it also has a few weak points: limited functions, little control over end user accessing code, relatively slow.
If you are looking for a database development system that allows you to create stand-alone code, full access to features of QDOS, relatively fast, and free, then DBAS is something that you should look into.
DBAS, also called Database Handler, is a library of database handling routines for SuperBasic, C68, or Machine Code. DBAS is not a database language system like Archive, so it is not a true replacement for Archive.
The core part of DBAS resides in DATA_BIN. It is loaded by LRESPR. DATA_BIN contains the main routines for database handling, but only for Machine Code programs. If you use SuperBasic, DBAS_BIN contains the SuperBasic interface to DATA_BIN, and it too is LRESPRed. For C68 programmers, there is a library of database routines that access DATA_BIN.
Programming with DBAS is not as easy as programming with Archive. You are using DBAS for database function calls, but you still have your programing control constructs (looping, branching, etc) in SuperBasic or C68. What you loose in ease of programming from Archive, you gain in power of programming. Since you are using SuperBasic or C68 to program in, you still have the full power of either language and all that they can do.
DBAS has both procedures and functions. A sampling of procedures is:
ADD_FIELD Add a field APPEND Add a new record CREATE Create a database EXCLUDE deselect records FIND Find by INSTR INCLUDE Select records LOCATE Find by ORDER parameters OPEN_DATA Open a database ORDER Order a database REMOVE Delete a record SEARCH Find by INCLUDE parameters UPDATE Update a record
A sample list of functions is:
COUNT Get record count FETCH Get record contents FLLEN Get field length FLNAME Get field name
Databases are treaded like files and are opened with the OPEN_DATA procedure. After that they are referred to by their channel number. Fields do not specifically have names – they are referenced by field number – but field names can be implemented with some work arounds.
DBAS does not seem to prohibit opening more than one database at one time, but I do not see in any of the commands where you can specify a JOIN ( selecting records from two databases/tables with a common equality). By doing a couple of searches on each database, you should be able to rig up the equivalency of a JOIN.
Since DBAS does not have a front-end for doing database creating, editing databases, etc, two utilities come with DBAS to make maintaining individual records easier. DBPTR_BIN is a Pointer Environment program for editing, adding, and deleting records. For non-PE users, there is ALTER_BIN. Both of these programs are executables.
DBAS has a lot of potential. Since it is LRESPRed, it is compatible with SuperBasic compilers, like QLiberator. You can compile your code and create a stand alone application. The _BIN files are freeware and can be distributed with your program.
DBAS comes with full documentation for all of its features, including the SuperBasic, C68, and Machine Code interfaces. It comes with example programs that help in learning how to use DBAS.
If you are new to databases and you want to learn how to program them, stay with Archive. If already know how databases work and want to develop your own stand-alone applications, then DBAS is worth the look.
DBAS should be available on most QL BBS’s worldwide. For North American QL users, you can get it from QHJ Freeware (me) (just send a disk with return postage).