Access wont permit database, recordset type

  • Thread starter Thread starter Jim McDonald
  • Start date Start date
J

Jim McDonald

Hi all "
I have been trying to convert a legacy db from Access97 to Access 2000, and
VBA code fails with unrecognised type or user type not defines etc when I
try to set types eg "global ThisDB as database, thisRS as recordset"
I've been using these methods for along time, and cant figure out why
suddenly they dont work. It may have something to do with References but I
have a big problem figuring which of the thousands of dll entries is
relevant.

H E L P ! ! ! !

Thanks

Jim McDonald
 
Database is a DAO object. By default, Access 2000 (and Access 2002, for that
matter) use ADO.

With any code module open, select Tools | References from the menu bar,
scroll through the list of available references until you find the one for
Microsoft DAO 3.6 Object Library, and select it. If you're not going to be
using ADO, uncheck the reference to Microsoft ActiveX Data Objects 2.1
Library

If you have both references, you'll find that you'll need to "disambiguate"
certain declarations, because objects with the same names exist in the 2
models. For example, to ensure that you get a DAO recordset, you'll need to
use Dim rsCurr as DAO.Recordset (to guarantee an ADO recordset, you'd use
Dim rsCurr As ADODB.Recordset)

The list of objects with the same names in the 2 models is Connection,
Error, Errors, Field, Fields, Parameter, Parameters, Property, Properties
and Recordset
 
Doug - Now fixed. Real Grateful - you made an old man happy! Thanks again
Jim MCDonald
 
Back
Top