More work on database access edition.

Needs some debug but hopefully will work.