
VBA 97 to VBA 2K/2002/2003
Quote:
> I have a vendor supplied A97 database (that is no longer
> in business) and I want to upgrade it. Some of his VBA
> code will not work in 2K. Is there anything out there
> that I can use to search through the code to find
> old "stuff" or find what won't work in A2K?
I can't think offhand of any A97 VBA that won't work in A2K+, provided
the correct references are set. By default, A2K and A2K2 don't include
a reference to the DAO library, but include an ADO reference instead.
If you copy code that includes Database and Recordset objects (among
others), you should delete the reference to ADO (Microsoft ActiveX Data
Objects 2.x Library) and add one for DAO (Microsoft DAO 3.6 Object
Library). That'll probably take care of most or all of your problems.
If you want to use both ADO *and* DAO, then you need both references,
but must disambiguate the declarations of a number of objects the two
libraries have in common; e.g.,
Dim rsDAO As DAO.Recordset
Dim rsADO As ADODB.Recordset
It's just as well to make a habit of dismbiguating the declarations of
any objects from these libraries.
--
Dirk Goldgar, MS Access MVP
www.datagnostics.com
(please reply to the newsgroup)