Script for db access