Application.References.Remove fails

  • Thread starter Thread starter Thor
  • Start date Start date
T

Thor

If I copy a database which references the msadox.dll from
mdac 2.7 to a computer with an earlier version of mdac I
get a compile error. When I try to run code to remove
this reference I get an error 'Object library not
registered'. Is there a way to remove this broken
reference so that I can add a reference to the msadox.dll
from the earlier mdac version?
 
What does your code look like? (This isn't an MDE, is it? You can't change
references in an MDE)
 
See whether

For Each refItem In Application.References
If refItem.IsBroken Then
Application.References.Remove refItem
End If
Next refItem

works
 
Same error. If I copy the database to a computer with
msadox.dll v2.5 or 2.6 that has Microsoft Access loaded I
can uncheck the 2.7 reference and select the 2.5
reference. But on the same computer doing this through
code fails. If I uncheck the 2.7 reference in the
References dialog then I can add the new reference through
code, but no luck removing it through code.
 
Back
Top