Back to index

LispMe HanDBase interface

HanDBase is a commercial database system for the Palm having a large customership. It provides a simple API which LispMe supports now.

The data model of HanDBase is very simple: A table in the relational model is a "database" in HanDBase jargon. It consists of a number of rows of identical format. Each record is identified by a number in the range [0..n-1]

To access a field value, you have to specify database name, record number and field number. The function hb-info retrieves catalog information of a database like number of records and types names and attributes of all fields.

There are no selection or filter functions, you have to traverse the entire database table to find a record.

Unfortunately, there's no clear distinction between internal and external data formats (all data is stored as strings in HanDBase), type conversion and syntax checking is done in various places in HanDBase. These problems get worse, as the formatted data is stored, so databases using different locales are not easily exchangable. Have a look at the sample how to parse the strings returned from HanDBase.

HanDBase provides limited relations between tables, i.e. a 1:n relationship. A record in table A can reference a set of records in table B and you can use the function hb-getlinks to retrieve the entire set. Unfortunately there's no function to go backwards, i.e. find the owner of the current record.

DDH Software changed the HanDBase API structures totally when introducing version 3. LispMe now supports both versions 2 and 3 of HanDBase. It automatically detects the version installed. If both versions are found, V3 is used. Use hb-version to detect the version used.

HanDBase types

HanDBase encodes field types using this table:

numerical valuesymboldescription
2HB_DECIMAL_FIELD numeric decimal (includes int)
3HB_FLOAT_FIELD numeric floating point
4HB_POPUP_FIELD selection list
6HB_UNIQUE_FIELD unique int given by system
7HB_IMAGE_FIELD image, not supported
10HB_LINK_FIELD 1:n relation
11HB_LINKED_FIELD target of 1:n relation
12HB_NOTE_FIELD string
13HB_HEADING_FIELD header in HanDBase editor
14HB_LINKLIST_FIELD value read once from another table
15HB_CALCULATED_FIELD calculated by HanDBase

HanDBase error codes

HanDBase errors always cause this error message. The error code included has the following meanings:

error codedescriptionremarks
2Couldn't find databaseNames are case-sensitive
3Couldn't open database
4Error reading record info
5Error reading recordIndex out of range
6Not a link fieldCan't use hb-getlinks

You should never see another error code, please mail me.

Associated language elements

hb-addrecord hb-dir hb-info hb-getfield
hb-getlinks hb-setfield hb-version