Add DAO Reference usin VBA.

A

ALESSANDRO Baraldi

Hi.
I need to create a new DB with DAO Reference.
So i need to set DAO(Last Version on Machine) and
uncheck ADO.

Thanks.
 
A

Alex Dybenko

Cao ALESSANDRO,
i think you can use automation to open your mdb with access, then use
references collection to add DAO reference and delete ADO
see online help for references collection for more info
 
A

ALESSANDRO Baraldi

Alex Dybenko said:
Ciao ALESSANDRO,
i think you can use automation to open your mdb with access, then use
references collection to add DAO reference and delete ADO
see online help for references collection for more info


Hi Alex, right i use Access Automation, i see on Help:

Dim ref As Reference
Set ref = References.AddFromFile(strNomeFile)
RiferimentoDaFile = True

I need to put in AddFromFile metod the Name of Reference File..!
Wich name i must put into it...?

For DAO i presume= dao360.dll
For ADO= msado15.dll

I need to retrive the SystemPath....where this Library are located...!!

Thanks Alex

I use this moment to give you and all NG People good Easter Day.

@Alex(Alessandro)
 
A

ALESSANDRO Baraldi

Alex Dybenko said:
Cao Alessandro,
to get SystemPath you can use this API function:
http://www.mvps.org/access/api/api0010.htm


Ciao Alex Grazie.

Work perfect the DAO setting, but to Remove
ADO i have some problem.
I need to check if DAO are just set, but until i
don't remove ADO i have some difficulties because
the CODE don't have EXPLICIT DAO.OBJECT
declaretion......!!!

Hi.

Alssandro.
 
D

Douglas J. Steele

ALESSANDRO Baraldi said:
Ciao Alex Grazie.

Work perfect the DAO setting, but to Remove
ADO i have some problem.
I need to check if DAO are just set, but until i
don't remove ADO i have some difficulties because
the CODE don't have EXPLICIT DAO.OBJECT
declaretion......!!!

To remove the ADO reference, try:

Dim refCurr As Reference

For Each refCurr In Application.References
If refCurr.Name = "ADODB" Then
Application.References.Remove refCurr
Exit For
End If
Next refCurr
 
A

ALESSANDRO Baraldi

"Douglas J. Steele" <NOSPAM_djsteele@NOSPAM_canada.com> ha scritto nel
messaggio [CUT]
To remove the ADO reference, try:

Dim refCurr As Reference

For Each refCurr In Application.References
If refCurr.Name = "ADODB" Then
Application.References.Remove refCurr
Exit For
End If
Next refCurr


Thanks it's very easy, easier than what I thought....!

Alessandro(IT)
 

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