[x]
Posted via EE Mobile

Search, ask, and monitor your questions on the go with EE Mobile. Visit Experts Exchange from your mobile device and never be out of touch again.

Question
[x]
Attachment Details
[x]
The Solution Rating System

With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.

  • The Grade of the Solution
  • The Zone Rank of the Expert Providing the Solution
  • The Number of Author and Expert Comments
  • The Number of Experts Contributing
  • The Feedback of the Community

Your Input Matters
Because of the way the system is set up, the most important variable in this equation is you. As a member of Experts Exchange, you are able to cast your vote on the quality of the solutions in regard to how complete, accurate, helpful and easy to understand each solution is. When you provide your feedback, each rating is adjusted accordingly. So, if you see a solution that has a poor rating that you think is a good solution, let us know by rating it. As you do, the rating will be adjusted and will become more accurate for other members of our site.

If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support.

Thank you!

8.4

Error

Asked by themikecooke in Active Server Pages (ASP)

Tags: object

I'm using a chat program and I keep getting an error and I can't seem to find it.  I need a fresh look.
The error is:
Microsoft VBScript runtime error '800a01a8'
Object required: '[undefined]'

default.asp, line 96
 
The code is
<%      Option Explicit %>
<!-- #include file="constants.inc" -->
<%
Dim ChatID
Dim requestedUsername
ChatID = Request("ChatID")
requestedUsername = Server.HTMLEncode( Request("username") )
' do not show login screen if a valid session exists
If (ChatID <> "") Then
      Response.Redirect "chat.asp?ChatID=" & ChatID
      Response.End
End If
Dim mode, x, errorMessage
mode = Request("mode")
If ( (mode = "userLogin") ) Then
      If ( Len(Request("username")) < 1 ) Then
            errorMessage = "You have to enter a username before starting to chat"
      Else
            ' Check if this user exist already
            requestedUsername = Left(requestedUsername, 20)
            If (Not FindUser(requestedUsername) AND (InStr(requestedUsername, "|") =

0)) Then
                  ' we have a new chat user thus we need to create a new
                  ' id for him/her
                  ChatID = CStr(Timer) ' safe enough for now
                  Application.Lock
                  Application.StaticObjects.Item("ASPChat").Add ChatID,

requestedUsername
                  Application.StaticObjects.Item("ASPChatTime").Add ChatID,

CStr(Now())
                  ' tell all other users about this new user'
                  For x = MESSAGES To 2 Step -1
                        Application("chatline_" & x) = Application("chatline_" &

x-1)
                  Next
                  Application("chatline_1") = "<tr><td align='right'><img

src='images/Enter.gif' height=14 width=14>&nbsp;</td><td><span class='loggedIn'>" &

requestedUsername & " logged on at " & now & "</span></td></tr>"
                  Application.Unlock
                  ' redirect to new frame window and create a new session,
                  ' if user has enabled session
                  Response.Redirect "Chat.asp?ChatID=" & ChatID
                  Response.End
            Else
                  errorMessage = "Sorry, but the name you chose is already in use.

Please choose another."
            End If
      End If
End If
%>
<html>
<head>
      <title>ASPChat On·Line</title>
      <link rel="stylesheet" type="text/css" href="Chat.css">
      <script language="JavaScript">
      <!--
            function setFocus()
            {
                  document.frmLogin.username.focus();
            }
      // -->
      </script>
</head>

<body topmargin="1" leftmargin="1" marginwidth="1" marginheight="1">
<form name="frmLogin" method="POST" action="Default.asp">
      <input type="hidden" name="mode" value="userLogin">
      <div align="center">
            <center>
            <table border="0" cellspacing="0" cellpadding="4" width="10">
                  <tr>
                        <td colspan="2"><span

class="Error"><%=errorMessage%></span></td>
                  </tr>
                  <tr>
                        <td bgcolor="#800000" colspan="2">
                              <b><font color="#FFFFFF">&nbsp;ASPChatWorX

3.0</font></b>
                        </td>
                  </tr>
                  <tr>
                        <td colspan="2">
                              <table border="0" width="100%" cellspacing="0"

cellpadding="0">
                                    <tr>
                                          <td width="50%">Chat

Name&nbsp;</td>
                                          <td width="50%"><input type="text"

name="username" class="editField" size="15" tabindex="1"></td>
                                    </tr>
                              </table>
                        </td>
                  </tr>
                  <tr>
                        <td>&nbsp;</td>
                        <td align="right">
                              <input type="image" name="login" value="submit"

src="images/Chat.jpg" border="0" width="90" height="30" tabindex="2">
                        </td>
                  </tr>
                  <tr>
                        <td colspan="2"><hr noshade color="#D0D0D0" size="1"></td>
                  </tr>
                  <tr>
                        <td colspan="2">Current chatusers (max. <%=USERS%>):</td>
                  </tr>
<%
Dim arUserNames, arUserIDs, i, chatName
arUserIDs = Application.StaticObjects.Item("ASPChat").Keys
arUserNames = Application.StaticObjects.Item("ASPChat").Items

For i = 0 To Application.StaticObjects.Item("ASPChat").Count-1
      If (ChatID = arUserIDs(i)) Then
            chatName = "<b>" & arUserNames(i) & "</b>"
      Else
            chatName = arUserNames(i)
      End If
      If ( i MOD 2 ) Then
            Response.Write "<tr bgcolor='#F8F8F8'>"
      Else
            Response.Write "<tr>"
      End If
      Response.Write " <td><img src='images/Chatter.gif' width=16 height=16></td>"
      Response.Write " <td width='100%' class='infoText'>" & chatName & "&nbsp;</td>"
      Response.Write "</tr>"
Next

If (Application.StaticObjects.Item("ASPChat").Count = 0) Then
%>
                  <tr>
                        <td colspan="2" class="infoHeader">&nbsp;&nbsp;&nbsp;No

users currently logged in.</td>
                  </tr>
<%
End If
%>            </table>
            </center>
      </div>
</form>

<script language="JavaScript">
      setFocus();
</script>

</body>
</html>
[+][-]08/16/04 11:39 AM, ID: 11813501Accepted Solution

View this solution now by starting your 30-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

About this solution

Zone: Active Server Pages (ASP)
Tags: object
Sign Up Now!
Solution Provided By: L00M
Participating Experts: 2
Solution Grade: B
 
[+][-]08/16/04 11:20 AM, ID: 11813341Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]08/16/04 11:26 AM, ID: 11813395Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
 
Loading Advertisement...
20091111-EE-VQP-92