Edited for Database getErrMsg test

First change to get error message from the database, if it works then
the rest will be replaced and then changed to the format Simon requires.