db40 database functions