[AccessD] ADOX references in Access

Leendert van Staalduinen l.van.staalduinen at hccnet.nl
Tue May 6 03:43:05 CDT 2003


I have a problem with ADOX references in Access. 

I develop on a PC and have a reference to msadox.dll. The Available References box shows: "Microsoft ADO Ext. 2.7 for DLL and Security" (which is ADOX version 2.7).
When I copy the application to another PC that has not the ADOX version 2.7 (but has a lower ADOX version), I find immediately a Broken Reference (shown in the Available References box as "MISSING:.").
Fixing it in the Available References box is simple though somewhat weird:
I know no better way than clearing the ADOX version 2.7 (which refers to .\ADO\msadox.dll), leave the Available References box, return to it and mark the "Microsoft ADO Ext. 2.1 for DLL and Security" (yes: ADOX version 2.1) and it is fixed. Why weird:  if I return the Available References box, it will show me "Microsoft ADO Ext. 2.5 for DLL and Security" or "Microsoft ADO Ext. 2.6 for DLL and Security" (yes: ADOX version 2.5 or 2.6). All references (broken or fixed) refer to the very same file .\ADO\msadox.dll.
 
Now my problem: how to do this in code. Come'on Access aficionados: don't' tell me:
           Access.Application.References.Remove References.Item(3)
           Call Access.Application.References.AddFromGuid( _
                "{00000600-0000-0010-8000-00AA006D2EA4}", 2, 1)
What's the problem:  the first line References.Remove References.Item(3)  does not work:
Err = -2147319779:   "Object Library not registered".
To be obvious: regsvr32  <path>\msadox.dll does not help.
I interpret this as: the program cannot handle the "Microsoft ADO Ext. 2.7 for DLL and Security" description as it is not known in the registry.

Anybody who can give me good advice. I want to have a bulletproof solution in VBA.
What I am not asking for is an answer like:
-          Fix it in the Available References box.
-          Install ADOX 2.7 (or MDAC 2.6, -2.7) on the other PC (these are PCs on client locations and they do not allow me to dictate the ADOX version (which would be ridiculous too)).
-          Make a Reference to ADOX 2.1 or ADOX 2.5 on your own PC: that does not help, it will show up again as ADOX 2.7.
 
Any good advice ?
Leendert van Staalduinen.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://databaseadvisors.com/pipermail/accessd/attachments/20030506/bca05863/attachment.html>


More information about the AccessD mailing list