setDB function

A function to set the connection to the database