Category : BASIC Source Code
Archive   : QB_DB3.ZIP
Filename : QBDB3.DOC

 
Output of file : QBDB3.DOC contained in archive : QB_DB3.ZIP























QuickBASIC (tm) DBASE III (tm) Routines

Programming Toolbox routines
For
QuickBASIC (tm) compiler










Written by

George Quinones
P.O.Box 1062
Orlando,Fl.,32802-1062
(305)894-0023






Copyright (c) 1987 by G. Quinones. all rigths reserved



QuickBASIC is a register trademark of MICROSOFT inc.
DBASE III is a register trademark of ASHTON TATE inc.

Quick Basic DBASE III Routines

INTRODUCTION




This tool box was designed to give the basic programmer the
ability to access DBASE III database files, (.DBF). Just about every
file operation is supported with the exception of memo fields and index
files. I am currently working in the routines to access memo fields,
in addition error checking, which do not exist in any of these demo
subroutines.

Four files are supplied with in this archive:

QBDB3.EXE A demo program showing the used of the
subroutines.

QBDB3.BAS Source code for the demo programm. The source
code for the demo program is included as a
sample on how to use the routines. Some of
the called modules used by the demo are
copyrighted by other companies, so I can not
release their source code.

QBDB3.DOC Documentation of the QBDB3 subroutines

QBDB3IO.OBJ This file contains all the necessary routines
to access DBASE III .DBF files. This file
consist of 10 file operations subprograms and
1 field operation subprogram. All of the
Subroutine have been compiled to use the
BRUN30.EXE module.

Some limitations have been built into the demo toolbox:

1) A maximum of 10 fields per record can be access
2) A maximum of 50 records per databes file.

By establishing these limitations it will ensure me that any
person that finds this library usefull will in fact register.

All the routines have been tested and found bug free when used in
accordance with their documentation. If you find that any of these
routines do not work properly as described, please let me know and I
will fix them promptly.

All the above routines are being supplied as is. I do not make
any implicit or explicit guaranties that they will work, and further
more will not assumed any responsability for the used or misused of
routines included within.

Quick Basic DBASE III Routines

OPEN DBASE III FILE






Purpose: Opens A DBASE III .DBF file for processing

Syntax : SUB DB.OPEN( _
DB.FX.%, _
DB.FX.NAME.$, _
DB.FIELDS.%, _
DB.LAST.OPEN.$, _
DB.HDR.LEN.%, _
DB.HDR.REC.TOT.!,_
DB.LEN.%)

Parameters: DB.FX.% Contains the file number of the
file to be opened.

DB.FX.NAME.$ Contains the name of the file
to be opened for processing
must have a .DBF.

DB.FIELDS.% Number of fields in the record.

DB.LAST.OPEN.$ Last date the file was used.

DB.HDR.LEN.% Length of the header structure.
!!DO NOT MODIFIED THIS FIELD!!!

DB.HDR.REC.TOT.! Number of records in the file.

DB.LEN.% Record Length.
























1

Quick Basic DBASE III Routines

CLOSE DBASE III FILE






Purpose: Closes a DBASE III .DBF.

Syntax: SUB DB.CLOSE( _
DB.FX.%, _
DB.FX.NAME.$, _
DB.HDR.REC.TOT.!, _
DB.RC.%)

Parameters: DB.FX.% Contains the file number of the
file to be opened.

DB.FX.NAME.$ Contains the name of the file
to be opened for processing
must have a .DBF.

DB.HDR.REC.TOT.! Number of records in the file.

DB.RC.% Return Code. !!!NOT IN USE!!!!


































2

Quick Basic DBASE III Routines

RETRIEVE STRUCTURE OF DBASE III FILE





Purpose: Retrieves DBASE III .DBF file Structure.

Syntax: SUB DB.STRUC( _
DB.FX.%, _
DB.FX.NAME.$, _
DB.NAME.$(), _
DB.LENGTH.%(), _
DB.TYPE.$(), _
DB.DEC.%(), _
DB.FIELDS.%, _
DB.LEN.%, _
DB.RC.%)

Parameters: DB.FX.% Contains the file number of the
file to be opened.

DB.FX.NAME.$ Contains the name of the file
to be opened for processing
must have a .DBF.

DB.NAME.$() Array containing the names of
the database record fields.

DB.LENGTH.$() Array containing the length of
the database fields.

DB.TYPE.$() Array containing the type of
the database fields.

DB.DEC.$() Array containing the decimal
positions of the database
fields.

DB.FIELDS.% Number of fields in the
database record.

DB.LEN.% Record Length.

DB.RC.% Return Code. !!!NOT IN USE!!!!














3

Quick Basic DBASE III Routines

CREATE DBASE III FILE






Purpose: Creates the header structure of a new DBASE III
.DBF file.

Syntax: SUB DB.CREATE( _
DB.FX.%, _
DB.FX.NAME.$, _
DB.NAME.$(), _
DB.LENGTH.%(), _
DB.TYPE.$(), _
DB.DEC.%(), _
DB.FIELDS.%, _
DB.LEN.%, _
DB.RC.%)

Parameters: DB.FX.% Contains the file number of the
file to be opened.

DB.FX.NAME.$ Contains the name of the file
to be opened for processing
must have a .DBF.

DB.NAME.$() Array containing the names of
the database record fields.

DB.LENGTH.$() Array containing the length of
the database fields.

DB.TYPE.$() Array containing the type of
the database fields.

DB.DEC.$() Array containing the decimal
positions of the database
fields.

DB.FIELDS.% Number of fields in the
database record.

DB.LEN.% Record Length.

DB.RC.% Return Code. !!!NOT IN USE!!!!












4

Quick Basic DBASE III Routines

READ DBASE III RECORD






Purpose: Retrieves a DBASE III by record number.

Syntax: SUB DB.GET( _
DB.FX.%, _
DB.NUM.%, _
DB.LEN.%, _
DB.HDR.LEN.%, _
DB.HDR.REC.TOT.!)

Parameters: DB.FX.% Contains the file number of the
file to be opened.

DB.NUM.% Contains the record number of
the database record to be
retrieve.

DB.LEN.% Record Length.

DB.HDR.LEN.% Length of the header structure.
!!DO NOT MODIFIED THIS FIELD!!!

DB.HDR.REC.TOT.! Number of records in the file.































5

Quick Basic DBASE III Routines

UPDATE DBASE III RECORD






Purpose: Updates a DBASE III record by record number

Syntax: SUB DB.PUT( _
DB.FX.%, _
DB.NUM.%, _
DB.LEN.%, _
DB.HDR.LEN.%, _
DB.HDR.REC.TOT.!)

Parameters: DB.FX.% Contains the file number of the
file to be opened.

DB.NUM.% Contains the record number of
the database record to be
retrieve.

DB.LEN.% Record Length.

DB.HDR.LEN.% Length of the header structure.
!!DO NOT MODIFIED THIS FIELD!!!

DB.HDR.REC.TOT.! Number of records in the file.






























6

Quick Basic DBASE III Routines

APPEND DBASE III RECORD






Purpose: Adds a DBASE III record.

Syntax: SUB DB.ADD( _
DB.FX.%, _
DB.NUM.%, _
DB.LEN.%, _
DB.HDR.LEN.%, _
DB.HDR.REC.TOT.!)

Parameters: DB.FX.% Contains the file number of the
file to be opened.

DB.NUM.% Contains the record number of
the database record to be
retrieve.

DB.LEN.% Record Length.

DB.HDR.LEN.% Length of the header structure.
!!DO NOT MODIFIED THIS FIELD!!!

DB.HDR.REC.TOT.! Number of records in the file.






























7

Quick Basic DBASE III Routines

DELETE DBASE III RECORD






Purpose: Marks a record a DBASE III record for deletion.

Syntax: SUB DB.DEL( _
DB.FX.%, _
DB.NUM.%, _
DB.LEN.%, _
DB.HDR.LEN.%, _
DB.HDR.REC.TOT.!)

Parameters: DB.FX.% Contains the file number of the
file to be opened.

DB.NUM.% Contains the record number of
the database record to be
retrieve.

DB.LEN.% Record Length.

DB.HDR.LEN.% Length of the header structure.
!!DO NOT MODIFIED THIS FIELD!!!

DB.HDR.REC.TOT.! Number of records in the file.






























8

Quick Basic DBASE III Routines

CONVERT RELATIVE RECORD # TO ABSOLUTE RECORD #






Purpose: Finds data base physical record number

Syntax: SUB DB.FIND.DB.REC( _
DB.NUM.%, _
DB.LEN.%, _
DB.HDR.LEN.%, _
DB.HDR.REC.TOT.!, _
DB.RECNUM.!, _
DB.L.%, _
DB.R.%)










































9

Quick Basic DBASE III Routines

RECALL DBASE III RECORD






Purpose: Recalls a DBASE III .DBF record by record number.

Syntax: SUB DB.RECALL( _
DB.FX.%, _
DB.NUM.%, _
DB.LEN.%, _
DB.HDR.LEN.%, _
DB.HDR.REC.TOT.!)

Parameters: DB.FX.% Contains the file number of the
file to be opened.

DB.NUM.% Contains the record number of
the database record to be
retrieve.

DB.LEN.% Record Length.

DB.HDR.LEN.% Length of the header structure.
!!DO NOT MODIFIED THIS FIELD!!!

DB.HDR.REC.TOT.! Number of records in the file.






























10

Quick Basic DBASE III Routines

PACK DBASE III FILE






Purpose: Removes all records marks for deletion in a DBASE
III .DBF file.

Syntax: SUB DB.PACK( _
DB.FX.%, _
DB.LEN.%, _
DB.HDR.LEN.%, _
DB.HDR.REC.TOT.!)

Parameters: DB.FX.% Contains the file number of the
file to be opened.

DB.NUM.% Contains the record number of
the database record to be
retrieve.

DB.LEN.% Record Length.

DB.HDR.LEN.% Length of the header structure.
!!DO NOT MODIFIED THIS FIELD!!!

DB.HDR.REC.TOT.! Number of records in the file.






























11

Quick Basic DBASE III Routines

CONVERT NUMBER TO STRING






Purpose: Convert a double precision number into a string so
it can be used by DBASE III.

Syntax: SUB DB.NUM.STR( _
DB.NUM.#, _
DB.DEC.%, _
DB.STR.NUM$)

Parameters: DB.NUM.# Contains the number to
converted to a string.

DB.DEC.% Contains the number of decimal
position that the number should
contain.

DB.STR.NUM.$ Number converted to string.




































12

Quick Basic DBASE III Routines

ORDER FORM






NAME ________________________________________

ADDRESS ________________________________________

CITY ________________________________________

STATE ________________________________________

ZIP CODE ______________________

PHONE (______)______--________

QuickBasic Ver: _____________








MAIL TO George Quinones
P.O.Box 1062
Orlando,Fl.,32803-1062




Make check for $20.00 payable to George Quinones. Please allow 2-3
weeks for delivery






















13


  3 Responses to “Category : BASIC Source Code
Archive   : QB_DB3.ZIP
Filename : QBDB3.DOC

  1. Very nice! Thank you for this wonderful archive. I wonder why I found it only now. Long live the BBS file archives!

  2. This is so awesome! 😀 I’d be cool if you could download an entire archive of this at once, though.

  3. But one thing that puzzles me is the “mtswslnkmcjklsdlsbdmMICROSOFT” string. There is an article about it here. It is definitely worth a read: http://www.os2museum.com/wp/mtswslnk/