Add db access code