DAO installation

I have MSOffice 2000 developer and have fully installed every bit of the 4GB provided on the 8CDs.

If I create a new database in Access 2000 I don't have access to any of the DAO functions/properties.  Most databases I am working on were upgraded from Access97.  In these databases I do have access to the DAO.  I generally use the DAO for recordsets.  I know there are alternatives but as I am more familiar with DAO I find it more productive.

Why can't I and how can I use the DAO in a new Access 2000 database?

Thanks,

Billy
LVL 6
billy21Asked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

BrianWrenCommented:
Be sure in the references dialog that the Microsoft DAO Library is present and is checked off.

Without the reference to the library, you won;t have any of the functions.

If it is not there, open one of the DBs that DOES have the DAO library, go to the references for that DB, select the DAO library and see where it is located.

Brian
0
chewhoungCommented:
Select Module tab on the database windows, click Design button on any existing module or click on New button, then click on Tools menu, then select Reference, then look for Microsoft DAO 3.6 object library within the Reference lists and check the check box and click on OK button.

After that select Debug menu, select the first menu in the debug menu to compile your database.
0
p_biggelaarCommented:
Just a bit of extra info:

Access 2000 is build around the ADO model, so it's default behaviour is having a reference included to ADO, ADOX and JRO. That's why you don't have standard access to the DAO functions and will have to do what BrianWen and chewhoung told you to.
0
Determine the Perfect Price for Your IT Services

Do you wonder if your IT business is truly profitable or if you should raise your prices? Learn how to calculate your overhead burden with our free interactive tool and use it to determine the right price for your IT services. Download your free eBook now!

billy21Author Commented:
Thank you chewdoung.  Please post an answer so I can award you the points.  Thank you pbig and brian for you input.  Brian, I didn't really understand what you wanted me to do as I didn't know anything about the references.

Billy
0
billy21Author Commented:
for an extra 50 points would you happen to know why this would produce the error "type mismatch"?

Dim Players As Recordset

Set Players = CurrentDb.OpenRecordset("qryPlayersRecordset", dbOpenDynaset)

I have used this method about a million times and this is the first time it has decided not to work.
0
p_biggelaarCommented:
If ADO is still referenced to (I hope it's now clear what is meant by that) and you now also have a reference to DAO, Access doesn't know what kind of Recordset you want to create, so it simply picks one of the two. In your case you're probably using DAO syntax\functions on a ADODB Recordset, which results in a type mismatch.

To make sure you use a DAO recordset you can:
- take the steps chewhoung mentioned, but this time remove the reference to ADO

or

-change the statement into Dim Players as DAO.Recordset

That way you shouldn't get the type mismatch anymore
0
p_biggelaarCommented:
PS do with the extra points whatever you like. I just happened to know the answer to a question that was not addressed to me. If you want to award them to one of the others.
0
wesleystewartCommented:
Just my $.02

You'll have to include the DAO. for every DAO object you declare because Access will first attempt to treat them as ADO objects.

You'll need to change:

db as database
rs as recordset
qd as querydef

to:

db as DAO.database
rs as DAO.recordset
qd as DAO.querydef

You can get around this by changing the order of the references.  Follow Chew's advice, and while you have the references dialog open, Click on the Microsoft DAO 3.6 object library and then click on the little up and down arrows until it is above the ADO reference (not sure exactly what it will be).

It is probably better programming practive to just make sure and declare each object with either an ADO. or DAO. to make sure Access treats them the way you expect.

Wes
0
BrianWrenCommented:
Ummm Billy21, ChewHoungs answer is a re-work of my answer...

Your call of course, but...

It seems that a clarification, (as chewhoung presented), deserves a pat on the back...

You can accept any comment as an answer by the selecting the button for that on the comment that you like...

Brian
0
p_biggelaarCommented:
I must agree with BrianWen.

He was first, and correct!
0
chewhoungCommented:
I know brianwen answer correctly but i guide billy21 to go to the correct place to check the reference. New user really don't know about that.

Billy21,

what happen if you run the query qryPlayersRecordset by itself? Meaning you double click on qryPlayersRecordset in the Query tab of database windows.

0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
billy21Author Commented:
Brian,

Your answer, while correct, did not correct my problem as I did not understand exactly what you wanted me to do.  The only reason I managed to install the DAO feature was  because Chewhoung posted a comment.

Chewhoung,

When I run the query It returns the two records I expect it to return.  It works that is.

I just tried wesley's suggestion and it worked.  so never mind.

WesleyStewart,

Thank you for your comment.  You will find a 50 point Q adressed to you just post an answer.
0
wesleystewartCommented:
Glad to help.

Wes
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Access

From novice to tech pro — start learning today.