Add DAO Reference usin VBA.

  • Thread starter Thread starter ALESSANDRO Baraldi
  • Start date Start date
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.
 
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
 
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)
 
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.
 
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
 
"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)
 
Back
Top