<%

CONST L_ErrorPage_HTMLTitle        = "Error page"
CONST L_TryTheFollowing_Text       = "Try the following: "

CONST L_Error_Text                 = " error"
CONST L_AnErrorOccurred_Text       = "An error occurred while trying to "

CONST L_AuthUser_Text              = "Authentication"
CONST L_Resolution_Text            = "Resolution"
CONST L_CDO_Text                   = "Collaborative Data Objects"
CONST L_ADO_Text                   = "Active Data Objects"
CONST L_CMSAdmin_Text              = "Exchange Conference Manager Admin"

CONST L_Organizer_Text             = "Organizer"
CONST L_Required_Text              = "Required"
CONST L_Optional_Text              = "Optional"
CONST L_Resource_Text              = "Resource"

CONST L_CreateAppointment_ErrorMessage    = "create the CDO 3.0 Appointment object"
CONST L_CreateCDOConfig_ErrorMessage      = "create the CDO 3.0 Configuration object"
CONST L_ParsingAuthUser_ErrorMessage      = "parsing the authenticated user string"

CONST L_CreatingAddressee_ErrorMessage    = "create the addressee object for "
CONST L_SettingDisplayName_ErrorMessage   = "set the display name of the addressee object for "
CONST L_CheckingName_ErrorMessage         = "check the name of the addressee object for "

CONST L_ResolvingAuthUser_ErrorMessage    = "resolve the authenticated user to a mailbox"
CONST L_ParsingAuthEmail_ErrorMessage     = "parsing the authenticated user's e-mail address"

CONST L_CreateConfiguration_ErrorMessage  = "create the Conference Management Server Configuration object"
CONST L_GetZone_ErrorMessage              = "get the Zone from the Conference Management Server Configuration object"
CONST L_GetResourceMailboxes_ErrorMessage = "get a list of Resource Mailboxes from the Zone object"
CONST L_CouldntFindResource_ErrorMessage  = "find the resource specified in the message"

CONST L_GettingConfigFields_ErrorMessage  = "get the Configuration object's Fields collection"
CONST L_SettingSendAddress_ErrorMessage   = "set the send address of the Configuration object"
CONST L_SettingSendUsing_ErrorMessage     = "set the SendUsing property of the Configuration object"
CONST L_SettingTimeZoneId_ErrorMessage    = "set the TimeZoneId property of the Configuration object"
CONST L_UpdatingConfigFields_ErrorMessage = "update the fields of the Configuration object"
CONST L_SettingConfig_ErrorMessage        = "set the Configuration object of the Appointment object"

CONST L_AddingNewAttendee1_ErrorMessage   = "add a new Attendee "
CONST L_AddingNewAttendee2_ErrorMessage   = " to the Appointment object"
CONST L_SettingAddress_ErrorMessage       = "set the e-mail address of the new Attendee "
CONST L_RecipientRole1_ErrorMessage       = "set the role of the participant "
CONST L_RecipientRole2_ErrorMessage       = " to "

CONST L_SettingEmailAddress_ErrorMessage  = "setting the e-mail address of the attendee: "
CONST L_AmbiguousNames_ErrorMessage       = "resolve the attendees of the meeting.  There was an ambiguous name: "
CONST L_UnresolvableNames_ErrorMessage    = "resolve the attendees of the meeting.  There was an unresolvable name: "

CONST L_ResolvingResource_ErrorMessage    = "resolve the resource to a mailbox"

CONST L_SettingBusyStatus_ErrorMessage    = "set the busy status of the meeting"
CONST L_AddingRecurPattern_ErrorMessage   = "add a recurrence pattern to the meeting"
CONST L_SetRecurFrequency_ErrorMessage    = "set the recurrence frequency of the meeting"
CONST L_SetRecurInstances_ErrorMessage    = "set the recurrence instances of the meeting"
CONST L_SetRecurPatternEnd_ErrorMessage   = "set the recurrence end date of the meeting"

CONST L_SettingApptFields_ErrorMessage    = "set the Exchange Conferencing properties on the Appointment object"
CONST L_UpdatingApptFields_ErrorMessage   = "update the Appointment objects' fields collection"
CONST L_SyncingApptFields_ErrorMessage   = "synchronize the Appointment objects' fields collection"

CONST L_ApptCreateRequest_ErrorMessage    = "create the calendar message for the Appointment object"
CONST L_ApptSend_ErrorMessage             = "send the meeting to other users"
CONST L_ApptSaveTo1_ErrorMessage          = "save the meeting to the "
CONST L_ApptSaveTo2_ErrorMessage          = " mailbox"

CONST L_GettingApptSource_ErrorMessage    = "get the URL that the appointment was saved to"
CONST L_ApptOpen_ErrorMessage             = "open the appointment from the following URL: "

CONST L_GettingCGOID_ErrorMessage         = "retrieve the message ID"
CONST L_URLFromCGOID_ErrorMessage         = "get the URL from the message ID"

CONST L_GetResourceMailbox_ErrorMessage   = "get a particular Resource Mailbox from the the list of Resource Mailboxes"
'CONST L_GettingApptFields_ErrorMessage    = "get the Appointment objects' fields collection"
CONST L_SetAttendeeType_ErrorMessage      = "set the type of the attendee to resource."
CONST L_GettingAuthUser_ErrorMessage      = "retrieve the name of the authenticated user"

DIM ErrorMsg        'Holds the main error message (displayed at the top of the error page)
DIM Reason          'Holds the paragraph description of the error (displayed below the main message)
DIM Fixes()         'Holds the suggested remedies (displayed in the bulleted list below the paragraph)
DIM Result          'Global variable used for function return values

DIM ErrCode
DIM ErrSource
DIM ErrDescription

ErrorMsg        = ""
Reason          = ""
Result          = 0

ErrCode         = 0
ErrSource       = ""
ErrDescription  = ""
REDIM Fixes(0)

FUNCTION CheckSetError(ResultSource, ResultReason)

    IF (0 <> Err.Number) THEN
        ErrCode        = Err.Number
        ErrSource      = Err.Source
        ErrDescription = Err.Description
        Err.Clear()
    ELSEIF (0 <> Result) THEN
        IF (IsNumeric(Result)) THEN
            ErrCode = CDbl(Result)
        ELSE
            ErrCode = Result
        END IF
        ErrSource      = ""
        ErrDescription = ""
        Result      = 0
    ELSE
        CheckSetError = FALSE
        EXIT FUNCTION
    END IF

    ErrorMsg = ResultSource & L_Error_Text
    Reason   = L_AnErrorOccurred_Text & ResultReason
    CheckSetError = ErrCode
    CALL DisplayErrorPage
END FUNCTION


SUB DisplayErrorPage() %>
<TITLE><%=L_ErrorPage_HTMLTitle%></TITLE>
</HEAD>
<body BGCOLOR="#FFFFFF" BACKGROUND="filespw.gif" LEFTMARGIN="40" RIGHTMARGIN="40" TEXT="#000000" LINK="#000000" ALINK="#FFCC66" VLINK="#0080FF" STYLE="background-color:#FFFFFF; background-image:url(filespw.gif); background-attachment:fixed; background-repeat:no-repeat; background-position:bottom right;">

<center>
<table CELLSPACING="12">
<tr><td COLSPAN="2" ROWSPAN="1" ALIGN="LEFT"><b><font FACE="verdana" SIZE="+3"><%=ErrorMsg%></font></b></td></tr>
<tr><td COLSPAN="2" ROWSPAN="1" ALIGN="LEFT"><font FACE="verdana" SIZE="-1">
    <%=Reason%>
    <P><%=L_TryTheFollowing_Text%></P>
    <UL>
        <%
            DIM count
            FOR count = 1 TO UBound(Fixes)
                Response.write("<LI>" + Fixes(count) + "</LI>")
            NEXT
        %>
    </UL>
    <P>
    <SMALL>
        Code:<%=ErrCode%>
        Source:<%=ErrSource%>
        Description:<%=ErrDescription%>
    </SMALL>
</font></td></tr>
</table>
</center>
</body>
</HTML>
<% Reponse.End %>
<% END SUB %>
