Hi Mike,
DAO and ADO both contain Database objects in their
libraries. If you only have a reference to one or the
other, you can use dim db as Database and VB will
interpret it as a database object in whichever library
you have referenced.
But, if you reference both libraries, you need to
explicitly tell VB which library you are using, thus the
DAO preface in the original code. Actually, I believe
that if you don't preface the variable, VB will interpret
it as whichever type you give higher priority to, but it
is really best to explicitly specify for clarity anyway.
Many recommend that even if you currently only use DAO or
ADO, you consider explicitly dimensioning database and
recordset variables in case you ever have a need to add a
reference to the other.
HTH
-Ted Allen