using thread to run function access_sql_server and function access_avls_server