In an Excel sheet you can Add a QueryTable object using the Data > Get External Data feature.
I do not recommend ADDING QueryTables via code. In my 20+ years of using QueryTables in Excel, I have not encountered a need to add QTs on the fly, although it can be done with care. You definitely do not want to have a bunch of unused QT objects cluttering up your workbook!
Once a QT is Added to a sheet, it is there until you Delete it. Until then, the Connect string and/or the SQL string can be modified as needed.
Of course, when you connect to a database there are a number of different kinds of database: Oracle, DB2, MS Access, SQL Server, Excel, Text File, Web. There may be more. These are the ones that I have tapped. With each you would have a unique Connection String.
The significant properties to manage in a QT are:
You have already set up your QT and it is returning data to your sheet from the database.
How can you determine the content of Connection String and/or SQL String?
When you look at the Immediate Window (ctrl+G), you will see two strings.
It happens that my QT is connected to another sheet/table in ThisWorkbook.