Query vs QueryDef 
Author Message
 Query vs QueryDef

I noticed that if I create a query in Access (Access 97) and save it and
then try to execute that query from within VB (VB 6 SP3) it fails. If I
take the same SQL string and save it as a QueryDef from within VB I can
use it.

Looking at the resultant query in Access there is no difference I can
see. Am I correct is assuming that Access queries cannot be executed
from with VB?

Just trying to understand this stuff. The books I have imply that but
don't really state it.

Wayne



Sun, 22 Sep 2002 03:00:00 GMT  
 Query vs QueryDef
This works for me. Just pass the query name in the openrecordset method
enclosed in quotes.

    Set db = OpenDatabase("d:\devdb\biblio.mdb")    
    Set rst = db.OpenRecordset("All Titles", dbOpenDynaset)


Quote:
> I noticed that if I create a query in Access (Access 97) and save it and
> then try to execute that query from within VB (VB 6 SP3) it fails. If I
> take the same SQL string and save it as a QueryDef from within VB I can
> use it.

> Looking at the resultant query in Access there is no difference I can
> see. Am I correct is assuming that Access queries cannot be executed
> from with VB?

> Just trying to understand this stuff. The books I have imply that but
> don't really state it.

> Wayne



Mon, 23 Sep 2002 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Newbiw having problems with Permanent QueryDef: Query input must contain at least one table or query

2. QueryDef vs Recordsets

3. Experts: DAO QueryDef vs. ADO Commands

4. QueryDef vs. Execute method

5. Opening a CrossTab query via QueryDef.OpenRecordset

6. My queryDef query?

7. QueryDef.Type property: "Hidden" queries

8. Update query with querydef object

9. query as a querydef with a public variable

10. Get querydef while running query

11. Question for anyone who has used parameter queries with querydef objects in VB

12. Parameter Queries Error using QueryDef

 

 
Powered by phpBB® Forum Software