Use table name instead of SQL statement.
Don't check if the DBQ value is an existing file, it can be a directory for the text driver.