Open a database connection