Problems from ADO Ext. 2.6 vs. ADO Ext. 2.5

D

Derek Richards

I have a VBA program written in Excel 97 on one machine (machine A)
with a reference pointing to ADO Ext. 2.5 for Security and DDL. The
VBA program was modified on another machine (machine B) also running
Excel 97 but with a reference to ADO Ext. 2.6...instead.

After the modifications on machine B, the reference is no longer ADO
Ext. 2.5 and changed to pointing to ADO Ext. 2.6 now.

When re-running it on machine A, the program gave many errors and the
reference was showing "Missing ADO Ext. 2.6 for Security and DDL".

My question was how to change the settings on either of the machines
to make the program work again on machine A. Is there anyway to
downgrade to ADO Ext. 2.5 for Security and DDL to make it run well on
machine A?

Thanks a lot!
 
D

Daniel Klann

The most reliable way is to use late binding over early binding. For
example, rather than using a statements like these:-

Dim adoxCatalog As ADOX.Catalog
Set adoxCatalog = New ADOX.Catalog

You'd use:-

Dim oADOXCatalog As Object
Set oADOXCatalog = CreateObject("ADOX.CATALOG")

You'd then convert any symbolic constants to literal constants e.g.

adoRS.Open "SELECT * FROM Table1", adocn, adOpenForwardOnly, adLockReadOnly

to:-

adoRS.Open "SELECT * FROM Table1", adocn, 0, 1

You can check that everything has worked correctly by removing the reference
and compiling your project (Debug, Compile).

Hope this helps,
Daniel
http://www.danielklann.com/excel/excelvba.htm
 
D

Derek

Thanks. Is there any way to make the new program run under
the older version 2.5 without changing any code?

-----Original Message-----
The most reliable way is to use late binding over early binding. For
example, rather than using a statements like these:-

Dim adoxCatalog As ADOX.Catalog
Set adoxCatalog = New ADOX.Catalog

You'd use:-

Dim oADOXCatalog As Object
Set oADOXCatalog = CreateObject("ADOX.CATALOG")

You'd then convert any symbolic constants to literal constants e.g.

adoRS.Open "SELECT * FROM Table1", adocn,
adOpenForwardOnly, adLockReadOnly
 

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