You can CreateQueryDef(), but if it is just for temporary use, there is no
need. You can just use a string containing a SELECT query statement and
OpenRecordset(), or Execute the string it is an action query.
Example 1: SELECT query:
Dim strSql As String
Dim rs As DAO.Recordset
strSql = "SELECT Customers.* FROM Customers;"
Set rs = dbEngine(0)(0).OpenRecordset(strSql)
...
Example 2: DELETE query:
strSql = "DELETE FROM Customers;"
dbEngine(0)(0).Execute strSql, dbfailOnError