sql query from vba

L

Lei Z

Is it possible to connect to database via DAO and ODBC and perform sql query
from VBA?

Thanks,
Lei
 
L

Lei Z

Hi Al,

I'm new to vba and Visio programming, so please bear with my basic
questions. I started with declaring a database object as follows:

Dim db1 As DAO.Database

But got a compilation error: 'User-defined type not defined.'

What am I missing?

Thanks,
Lei
 
M

Mark Nelson [MS]

Go to Tools > References in VBA and put a check next to DAO. This type
library is not included in your project by default.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top