Small refactor to ensure connection.close

In ACCOUNTINGPERIOD.cs added connection.open and connection.close to
ensure closure on executing sql statement.