QueryDef Questions

Vigilante001

A Jolly Fellow...
Local time
Today, 16:41
Joined
May 16, 2008
Messages
28
Hello All,

I am just beginning my jump into DAO Objects in Access, and had a quick question or two.

1. Is a QueryDef the same as an Access Query object? My meaning is, does it function like a SQL "CREATE TABLE" statement to create a clickable object, and if not, what does the code:

Code:
Dim db As Database 'Create the database object
Dim qdf As DAO.QueryDef 'Create the QueryDef object (a query)
Dim SQL As String 'Create a String object

SQL = "SELECT * FROM SampleData" 'Define the String with an SQL statement

Set db = CurrentDb 
Set qdf = db.CreateQueryDef("HiThere", SQL)

actually do?



2. Any favorite resources you could point to on using QueryDef or DAO?

Thanks!
 
1. Is a QueryDef the same as an Access Query object?
YES.
what does the code:

Code:
Dim db As Database 'Create the database object
Dim qdf As DAO.QueryDef 'Create the QueryDef object (a query)
Dim SQL As String 'Create a String object

SQL = "SELECT * FROM SampleData" 'Define the String with an SQL statement

Set db = CurrentDb 
Set qdf = db.CreateQueryDef("HiThere", SQL)

actually do?
It creates a query called "HiThere" that you will see in the database window.
 

Users who are viewing this thread

Back
Top Bottom