When you have opened the query builder it is automatically connected to the active database used by Network Inventory but you can open another Network Inventory database. To open a database press Open Database button on the tool bar of the Query Builder. The Open Database dialog will appear on the screen. Pic 1
In the Open Database dialog you are proposed to choose the inventory database to open. Select the database and press OK button to proceed. The database selected is now opened.