Office 2003 SP3 broke my vba code "user-defined type not defined"

D

DAB

After installing Office2003 SP3 I get the following error...
[Microsoft Visual Basic]
Compile error:
User-defined type not defined
The same database run on an Office2003 SP2 machine works fine.

Also, as I am creating a new database, just after saving the new name
db1.mdb, I get another error...
[Microsoft Visual Basic]
Object Library not registered

Any assistance would be GREATLY appreciated
 
T

Tony Toews [MVP]

DAB said:
After installing Office2003 SP3 I get the following error...
[Microsoft Visual Basic]
Compile error:
User-defined type not defined
The same database run on an Office2003 SP2 machine works fine.

Also, as I am creating a new database, just after saving the new name
db1.mdb, I get another error...
[Microsoft Visual Basic]
Object Library not registered

Interesting. What are your references? The following is some VBA code
to put them in the debug window.

Dim ref As Reference

For Each ref In Access.References
Debug.Print ref.Name & " " & ref.FullPath & " " & ref.Major &
"." & ref.Minor
Next ref

Tony
--
Tony Toews, Microsoft Access MVP
Please respond only in the newsgroups so that others can
read the entire thread of messages.
Microsoft Access Links, Hints, Tips & Accounting Systems at
http://www.granite.ab.ca/accsmstr.htm
Tony's Microsoft Access Blog - http://msmvps.com/blogs/access/
 
D

DAB

Thanks for taking the time to look into my post!
Again, this code all works fine in Access 2003 with SP2 installed, just not
after installing SP3.

There was another initial message that only came up once that I forgot about
in my initial post...
[Microsoft Visual Basic]
Compile error:
Error in loading DLL
and the following line of code is selected with the word Connection
highlighted...
strSQL = "SELECT * FROM tblImport"
rstImport.Open strSQL, CurrentProject.Connection, adOpenKeyset,
adLockOptimistic, adCmdText
.... I added the previous (strSQL=) line for clarity

Here are the References you asked about...
VBA C:\Program Files\Common Files\Microsoft Shared\VBA\VBA6\VBE6.DLL 4.0
Access C:\Program Files\Microsoft Office\OFFICE11\MSACC.OLB 9.0
stdole C:\WINDOWS\system32\STDOLE2.TLB 2.0
DAO C:\Program Files\Common Files\Microsoft Shared\DAO\DAO360.DLL 5.0
Scripting C:\WINDOWS\system32\scrrun.dll 1.0
Office C:\Program Files\Common Files\Microsoft Shared\OFFICE11\MSO.DLL 2.3
ADOR C:\Program Files\Common Files\System\ado\msador15.dll 2.8
ADODB C:\Program Files\Common Files\System\ado\msado15.dll 2.8
ADOX C:\Program Files\Common Files\System\ado\msadox.dll 2.8

I probably have a strange mix as I was trying various references based on
other posts I was reading.

Tony Toews said:
DAB said:
After installing Office2003 SP3 I get the following error...
[Microsoft Visual Basic]
Compile error:
User-defined type not defined
The same database run on an Office2003 SP2 machine works fine.

Also, as I am creating a new database, just after saving the new name
db1.mdb, I get another error...
[Microsoft Visual Basic]
Object Library not registered

Interesting. What are your references? The following is some VBA code
to put them in the debug window.

Dim ref As Reference

For Each ref In Access.References
Debug.Print ref.Name & " " & ref.FullPath & " " & ref.Major &
"." & ref.Minor
Next ref

Tony
--
Tony Toews, Microsoft Access MVP
Please respond only in the newsgroups so that others can
read the entire thread of messages.
Microsoft Access Links, Hints, Tips & Accounting Systems at
http://www.granite.ab.ca/accsmstr.htm
Tony's Microsoft Access Blog - http://msmvps.com/blogs/access/
 
T

Tony Toews [MVP]

DAB said:
Again, this code all works fine in Access 2003 with SP2 installed, just not
after installing SP3.

Now I do not know why SP3 would break this however ...
rstImport.Open strSQL, CurrentProject.Connection, adOpenKeyset,
adLockOptimistic, adCmdText

This is ADO code.
Here are the References you asked about...
VBA C:\Program Files\Common Files\Microsoft Shared\VBA\VBA6\VBE6.DLL 4.0
Access C:\Program Files\Microsoft Office\OFFICE11\MSACC.OLB 9.0
stdole C:\WINDOWS\system32\STDOLE2.TLB 2.0

Above are required.
DAO C:\Program Files\Common Files\Microsoft Shared\DAO\DAO360.DLL 5.0

Now DAO can be used but you may want the ADO reference to be above the
DAO reference if you use ADO code primarily. Or you want to
disambiguate the methods that are common to ADO and DAO but putting
ADO or DAO in front of them.
Scripting C:\WINDOWS\system32\scrrun.dll 1.0
Office C:\Program Files\Common Files\Microsoft Shared\OFFICE11\MSO.DLL 2.3

The above two I have no idea why you'd want them. Are they really
used? If not uncheck them and compile your project to see if you get
any errors.
ADOR C:\Program Files\Common Files\System\ado\msador15.dll 2.8
ADODB C:\Program Files\Common Files\System\ado\msado15.dll 2.8
ADOX C:\Program Files\Common Files\System\ado\msadox.dll 2.8
I probably have a strange mix as I was trying various references based on
other posts I was reading.

Ah, ok, that makes more sense. You don't need the ADOR or ADOX.
Well, the ADOX is used for updating the table schema and such so if
you're not doing that kind of stuff then uncheck it. I have no idea
what the ADOR is so I'd also remove it and compile the code.

The ADODB is the reference required for ADO. As previously stated you
might want to move that one above DAO.

Tony
--
Tony Toews, Microsoft Access MVP
Please respond only in the newsgroups so that others can
read the entire thread of messages.
Microsoft Access Links, Hints, Tips & Accounting Systems at
http://www.granite.ab.ca/accsmstr.htm
Tony's Microsoft Access Blog - http://msmvps.com/blogs/access/
 

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