apv_ModelCreate function

Added database connection to model create