If you are using host variables, connecting to the executeQuery action before the window is opened will have unpredictable results because the host variables cannot be resolved.