I don't think so. The method you are using creates queries on the fly. To actually create a phsical query you'll have to use querydefs collection to add a query to your db. This is as far as I know. maybe someone has a better solution.
Originally posted by access_dude
I want to create a query in code. I'm using a MS Access 2000 database. I do not want to use older methods of query creation I.E. only use what's built in if possible no DAO.
I've identified a technique. The only drawback is that it creates Invisibile queries! Does anyone know of a method that works just like the old DAO / CreateQueryDefs method?
The current method I'm trying does not result in queries that appear in the Database Window (Even through they actually exist)
dim cn as adodb.connection
set cn = currentproject.connection
cn.execute "Create View qryTest as Select * from tblTest'"
set cn = nothing
Are you opposed to using the DoCmd object with the RunSQL method?