Assigning Quey values to VBA Variables, help = tutorial needed

timhysniu

New member
Local time
Today, 11:36
Joined
Jul 22, 2005
Messages
8
Hi there,

I have a question regarding accessing databases using VBA from Access forms. All the tutorials I have found are either way too basic or they have overwhelming amount of info (I tend to lose focus with the later ones). Basically all I am looking for is this:

- Connecting to and using database programmatically
- how to use Connection Strings to connect to database
- how to use a Recordset and its methods
- how to execute SQL queries properly using VBA (only the execution, SQL i already know)

- Using executed queries' values
- can you invisibly run queries and extract the valuable information to VBA variables
- Say I'm running a query to find max() or sum() or what not for a field. How can I assign a cell (for example field(1) and row(1) of 'query1') to a variable in VBA.
- how to manipulate fields programmatically. examples.

- ADODB is supported but DAO is nowhere under my libraries. Why is this? Do i have to install it or I just don't know how to find it? My VBA doesnt recognize DAO.Recordset

I am not being lazy. I'd read whatever it takes to learn all this. I've had bad experiences with all books though; most don't have this information. I hope you can provide me with some sources. If you have time to answer anything, I would greatly appreciate as well. My objective is to extract queries' values to variables and use them. No more or less. Anything I have to learn on the way is welcome.

Thank You so much
Tim
 
Thanks so much for the response. What it seems is I'm really stuck with DAO.
Why is it not under my libraries. Is this something I should install, or is it already there? Why doesnt Access recognize the library, say:

Dim asd As DAO.Recordset ' syntax error

thanks again
tim
 
Tim,

Get your code in Design View,
Tools --> References

Scroll down to Microsoft DAO & check it.

Since you have defined your recordset as DAO.Recordset (explicitly), you
don't really have to "prioritize" it above your ADO reference.

Wayne
 

Users who are viewing this thread

Back
Top Bottom