Office 2003 SP3 broke my vba code "user-defined type not defined" - ADO DAO RDO RDS

This is a discussion on Office 2003 SP3 broke my vba code "user-defined type not defined" - ADO DAO RDO RDS ; 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 ...

+ Reply to Thread
Results 1 to 4 of 4

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

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

    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

  2. Default Re: Office 2003 SP3 broke my vba code "user-defined type not defined"

    DAB <DAB@discussions.microsoft.com> wrote:

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

  3. Default Re: Office 2003 SP3 broke my vba code "user-defined type not defin

    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 [MVP]" wrote:

    > DAB <DAB@discussions.microsoft.com> wrote:
    >
    > >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/
    >


  4. Default Re: Office 2003 SP3 broke my vba code "user-defined type not defin

    DAB <DAB@discussions.microsoft.com> wrote:

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

+ Reply to Thread

Similar Threads

  1. can't compile, user defined type not defined
    By Application Development in forum ADO DAO RDO RDS
    Replies: 2
    Last Post: 10-14-2008, 11:14 AM
  2. Removal of "Defined Before Used" Rule from Fortran 2003
    By Application Development in forum Fortran
    Replies: 2
    Last Post: 09-26-2007, 03:28 PM
  3. On all but one dev machine: "Type <this> is not defined" errors
    By Application Development in forum DOTNET
    Replies: 0
    Last Post: 05-23-2007, 10:16 AM
  4. "Data type not defined" Error when Loading Dataset: Please HELP!
    By Application Development in forum XML SOAP
    Replies: 0
    Last Post: 04-20-2006, 11:53 AM
  5. Replies: 2
    Last Post: 08-11-2004, 02:00 AM