ADO Ext. 6.0 vs 2.X (1 Viewer)

CarlS

New member
Local time
Today, 04:12
Joined
Oct 13, 2007
Messages
2
Hello.
I am creating an Access 2003 application in Windows Vista. The only reference available for ADO Ext. for DDL and Security is Ver. 6.0 (library msadox.dll). When I distribute the application to a Windows XP SP2 user using Access 2003, the reference is not found since Ver. 6.0 is Vista specific. Naturally, this causes an error. If the XP user changes the reference to 2.8 (also msadox.dll, just a different version), he can then run the application no problem.

Is there a way for me to reference msadox.dll directly in my application instead of using the library reference? If not, any other suggestions? This application will be shared among Vista and XP users.

Thank you.
 

RoyVidar

Registered User.
Local time
Today, 12:12
Joined
Sep 25, 2000
Messages
805
I seldom use ADOX, but the few times I do, I'll late bind it. I e
Code:
Dim cat as object ' adox.catalog

Set cat = CreateObject("ADOX.catalog")
With cat
    Set .ActiveConnection  = CurrentProject.Connection ' or some connection
...
Note, I think there are some situations where ADOX can't late bind, but that should be fixed by 2.5 version.

I think I'd also recommend to develop in the lowest version you'll be distributing to, or at least test, perhaps /decompile, compile, compact & repair in that version before distributing.

I haven't done anything Access/Vista yet, have you read about some of the bugs? Allen Browne mentions a couple on his main tips page http://allenbrowne.com/tips.html and, if it applies http://allenbrowne.com/bug-17.html
 

CarlS

New member
Local time
Today, 04:12
Joined
Oct 13, 2007
Messages
2
Excellent idea, Roy.

I read up on late binding, and although early binding is typically preferred, this particular situation seems to be a time where late binding is an appropriate solution.

Thank you for the links to Allen Browne's website - it looks very helpful.
 

PeterOC

Registered User.
Local time
Today, 18:12
Joined
Nov 22, 2007
Messages
80
Missing ref to msadox.dll

Hi,
I'm having a similar problem - creating a app using Access 2007 & Vista to be distributed to users with XP sp2 and Access 2003. The users are getting the missing reference error message and I think it's behind several things not working in the app.

Roy / Carl could you explain in greater detail the late-binding process? Is this just a case of copying the dll to a central location and referencing this in code?

Regards,

Pete
 

PeterOC

Registered User.
Local time
Today, 18:12
Joined
Nov 22, 2007
Messages
80
Some extra info on this problem

Error message:
Your <Database Name> database or project contains a missing or broken reference to the file 'msadox.dll' version 6.0

I've checked on one of the users pc's using regedit and navigating to
HKEY_LOCAL_MACHINE\Software\Microsoft\DataAccess

(as described in http://support.microsoft.com/kb/301202)

version is 2.81.1117

I tried to download the latest version of MDAC but it said that the installation had failed as all the components already existed on windows. I registered msadox.dll using:
regsvr32 "C:\Program Files\Common Files\System\ado\msadox.dll" but when I looked in references I still see "Missing Microsoft ADO Ext 6.0 for DDL and Security". One site I check suggest ticking of this and checking "Microsoft ADO Ext 2.8..." but there's no sign of this either.

I'm a bit stumped. If the latest version of MDAC is installed why am I getting the error message? And why can't I see the ref for ADO 2.8?

If I turn the reference off on my Vista PC, decompile / recompile and redistribute the app will this solve the problem?

Cheers,
P
 

RoyVidar

Registered User.
Local time
Today, 12:12
Joined
Sep 25, 2000
Messages
805
The problem is that Vista comes with ADO 6.0, and previous versions of OS comes with/uses ADO/MDAC 2.#.

When creating a db with 2007/Vista, lower versions doesn't cope (isn't able to understand that it should use ADO 2.# in stead, and gives such message), while when creating the db on lower versions of OS, it's usually unproblematic to open it with later versions (there are exceptions, most of them explained in the links I gave). Same goes for some of the other libraries. If developed on Office 2007, you'll often have issues with Access not being able to run any code due to wrong references when opening in lower versions. Therefore I will often recommend (as I did in my first reply), to develop in the lowest version that it will be used on, and do a /decompile before deploying.

Greater detail on late binding?

In stead of

Dim cat as ADOX.Catalog
Set cat = New ADOX.Catalog

remove the reference and use what I gave in first reply. I'll often develop using early binding, to get the benefit of the 'Intellisence', then switch to late binding when deploying. Late binding is supposed to be slower than early binding, but with todays computers, I doubt you'll be able to notice any difference.

But why do you need ADOX? I find the only thing I would need ADOX for, would be to create a new database (mdb-file), everything else, I'd be able to do through DDL. Anyway, most people using Jet database, will recommend DAO, not ADO (unless one is working with technologies that cannot use DAO, for instance VBScript).

Search for late binding and/or CreateObject to find more samples and discussion on the subject.
 

PeterOC

Registered User.
Local time
Today, 18:12
Joined
Nov 22, 2007
Messages
80
Thanks for the reply Roy. Well, I'm not using ADOX. I didn't really understand that at first so was a bit leery about switching off the reference. But I've now done that and redistributed the Front end and the error messages are no longer appearing. I'm planning to uninstall A2007 and revert back to A2003 so I'm developing on the same platform as is being currently used at the client site.
 

Users who are viewing this thread

Top Bottom