1
votes

Thanks for help with previous question.

SUMMARY:

I'm trying to open an access 2000 file in access 2003 but Microsoft Access 9.0 Object Library is missing. any ideas??

BACKGROUND:

I recently inherited an access 2000 file containing a number of automated reports. When I try to open I get the following error:

Visual Basic for Applications (VBA) encountered a problem while attempting to access a property or method. The problem may be one of the following: A reference is missing. For help restoring missing references, see the Microsoft Knowledge Base article 283806. An Expression is misspelled. Check all expressions used in event properties for correct spelling.

I read the knowledgebase artice and it wan't very helpful. Advised me to delete the libary marked MISSING. But there wasn't one!

We checked the referenced libraries on the old machine and they were:

Visual Basic for Applications Microsoft Access 9.0 Object Library OLE Automation Microsoft ActiveX Data Objects 2.1 Library

All were present in access 2003 except Microsoft Access 9.0 Object Library.

According to here:

http://allenbrowne.com/ser-38.html

The file should live in

C:\Program Files\Microsoft Office\Office\msacc9.olb

I got a copy of that file from the old machine (not sure if that's strictly kosher) and tried to import it but to no avail.

Can anyone help??

1
Is a reference set to the Access 10.0 Automation library? It should cover all the 9.0 library.Dale
Also check again when you open it and gives this message, are you sure there isn't a library there with MISSING appended to its name? It is kind of hard to see and I have missed them plenty of times.Dale
Does the new A2003 MDB have the Access 11.0 Object Library? Access should have changed the reference as soon as you opened the MDB.Tony Toews
Yes. This situation is very confusing, as that's a required Access reference, and should dynamically update according to which version of Access you open it in. I think some information has been left out of the question.David-W-Fenton

1 Answers

1
votes

You might have noticed that your previous Access mdb referenced Microsoft ActiveX Data Objects 2.1 Library, and did not reference any Microsoft DAO Object Library. If, in your Access 2003 file, you are referencing DAO library before ADO library, and if the original code is poorly written, where in particuler recordsets are declared this way:

dim rs as recordset

instead of

dim rs as ADODB.recordset

You will typically get the kind of error you have, where the program will consider it is using a DAO recordset, while the code was written for an ADO one. Instruction such as:

rs.open
rs.fields(0).definedSize

can provoke your error