Error with VBScript class instantiation

Posted on 2007-10-17
Last Modified: 2008-12-30
I have the following class created:

      Class ErrObject
            Dim ErrorArray

            Private Sub ErrorObject_Initialize
            End Sub

            Sub addError(errorValue)
                  ' Expand size of array by 1
                  Redim Preserve ErrorArray(UBound(ErrorArray)+1)

                  ' Append error code to array
                  ErrorArray(UBound(ErrorArray)) = errorValue
            End Sub

            Function printError(beforePrintText, beforeErrorItemText, AfterErrorItemText, AfterPrintText)
                  Dim r

                  r = beforePrintText
                  for each x in ErrorArray
                        r = r & beforeErrorItemText & getErrorMessage(x) & afterErrorItemText
                  r = r & afterPrintText
                  printError = r
            End Function
      End Class

I also have the following call to this class:

            Dim eo
            eo = New ErrObject

However, when I attempt to load the page, I get this error:
Microsoft VBScript runtime  error '800a01b6'
Object doesn't support this property or method

Is there something I'm doing wrong? This seems like a pretty obvious thing.
Question by:jameswalt
    LVL 23

    Accepted Solution

    you missing "Set"

                Dim eo
                Set eo = New ErrObject

    Author Comment

    wow... that was way too easy. lot of wasted time for something so silly.


    Featured Post

    Threat Intelligence Starter Resources

    Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

    Join & Write a Comment

    The debugging module of the VB 6 IDE can be accessed by way of the Debug menu item. That menu item can normally be found in the IDE's main menu line as shown in this picture.   There is also a companion Debug Toolbar that looks like the followin…
    Article by: Martin
    Here are a few simple, working, games that you can use as-is or as the basis for your own games. Tic-Tac-Toe This is one of the simplest of all games.   The game allows for a choice of who goes first and keeps track of the number of wins for…
    As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
    Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

    729 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    18 Experts available now in Live!

    Get 1:1 Help Now