Added cases to functions to use odbc for message storing and retrieval