tags:

views:

116

answers:

1

Hi,

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??

A: 

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

Philippe Grondier
I would say an Access database with a reference do ADODB is badly written (if it's needed, and it almost never is, it should be used via late binding), but I'm very anti-ADO in Access.
David-W-Fenton
David W. Fenton: "if [ADODB] is needed...it should be used via late binding": can you give any good reason or is this mere bigotry?
onedaywhen
I learned a new word in english today: "bigotry"!
Philippe Grondier