Solved

Cannot get Global.asa file to work

Posted on 2001-07-01
22
238 Views
Last Modified: 2010-05-19
I downloaded an ASP Chat that i want to try out.
I've got IIS4 Server, and i've put the code on a
vertual directory.
when i access it, it works.
I write: http://127.0.0.1/virualdir/default.asp.
So the chat program come out...works ok, except 1 thing.
The Global.asa file contains some default room names,
and i can add more if i want, so i add my new chat rooms,
and when i run the chat program, nothing comes out in
the chat room's drop-down menu.
Please help me, i don't know what's going on.

Thanks a lot.

sfern.
0
Comment
Question by:sfern
  • 12
  • 7
  • 2
  • +1
22 Comments
 
LVL 1

Expert Comment

by:EKassan
ID: 6242261
Post your global.asa
0
 

Author Comment

by:sfern
ID: 6242269
OK Here's the code, although i think that the problem is
that i haven't setup everything right.

Here's the Global.asa code:

<SCRIPT LANGUAGE=VBScript RUNAT=Server>
 
ReDim TopicName(0)
ReDim TopicDescription(0)

 
 Sub Application_OnStart

     '###########################################################
     ' set title
     Application("Title") = "ASP Chat"
     ' Create your chat rooms below, do not modify anything else/
     CreateRoom "ASP Joint", "ASP fiends sharing dope"
     CreateRoom "ASP Joint2", "ASP fiends sharing dope"
     CreateRoom "ASP Joint3", "ASP fiends sharing dope"
     'CreateRoom "Room Name", "Room Description"
     '###########################################################
      
     Application("TopicNames") = TopicName
     Application("TopicDescriptions") = TopicDescription

     Dim Users()
     Redim Users(1)
     Dim UsersGroup()
     Redim UsersGroup(1)
     Application("Users") = Users
     Application("UsersGroup") = UsersGroup

     Dim UsersIP()
     Redim UsersIP(1)
     Dim UsersTimeOn()
     Redim UsersTimeOn(1)
     Dim UsersIdleOn()
     Redim UsersIdleTime(1)
     Application("UsersIP") = UsersIP
     Application("UsersTimeOn") = UsersTimeOn
     Application("UsersIdleTime") = UsersIdleTime

 End Sub

 Sub Session_OnStart
   Session.Timeout=2
 End Sub

 Sub Session_OnEnd
    Topic = Session("Topic")
    Name = Session("Name")

    Users = Application("Users")
    UsersIP = Application("UsersIP")
    UsersTimeOn = Application("UsersTimeOn")
    UsersIdleTime = Application("UsersIdleTime")

    Match = 1
    If IsArray(Users) Then
           UsersGroup = Application("UsersGroup")
           NumOfUsers = UBound(Users)
           If NumOfUsers = 1 Then
                 Set Application("Users") = Nothing
                 Set Application("UsersGroup") = Nothing

                 Set Application("UsersIP") = Nothing
                 Set Application("UsersIdleTime") = Nothing
                 Set Application("UsersTimeOn") = Nothing
           Else
              ReDim UpdatedUsers(1)
              ReDim UpdatedUsersGroup(1)

              ReDim UpdatedUsersIP(1)
              ReDim UpdatedUsersTimeOn(1)
              ReDim UpdatedUsersIdleTime(1)
              For I = 1 To NumOfUsers
                  If Name <> Users(I) Then
                       ReDim Preserve UpdatedUsers(Match)
                       ReDim Preserve UpdatedUsersGroup(Match)
                       UpdatedUsers(Match) = Users(I)
                       UpdatedUsersGroup(Match) = UsersGroup(I)


                       ReDim Preserve UpdatedUsersIP(Match)
                       ReDim Preserve UpdatedUsersTimeOn(Match)
                       ReDim Preserve UpdatedUsersIdleTime(Match)
                       UpdatedUsersIP(Match) = UsersIP(I)
                       UpdatedUsersTimeOn(Match) = UsersTimeOn(I)
                       UpdatedUsersIdleTime(Match) = UsersIdleTime(I)

                       Match = Match + 1
                  End If
              Next
              Application("Users") = UpdatedUsers
              Application("UsersGroup") = UpdatedUsersGroup

              Application("UsersIP") = UpdatedUsersIP
              Application("UsersTimeOn") = UpdatedUsersTimeOn
              Application("UsersIdleTime") = UpdatedUsersIdleTime

           End If
   End If


   Set fileObject = Server.CreateObject("Scripting.FileSystemObject")
   textFile = Application("filebase") & Replace(Topic, "+", "_") & ".txt"
   'If fileObject.FileExists(textfile) Then
         Set inStream = fileObject.OpenTextFile(textFile,1,TRUE,FALSE)
         file = inStream.ReadAll
         Set inStream = Nothing

         file = file & "<FONT SIZE=2 FACE='Vedana,Arial' Color=#808080><b>***[" &  Name & " has exited (" & Now & ")]***</b></FONT><br>"
         Set outStream = fileObject.CreateTextFile(textFile,True)
         outStream.WriteLine(file)
       outStream.Close
         Set outStream = Nothing
   'End If

   Session("Enter") = True
 End Sub

 Sub CreateRoom(Name, Description)
               nLen = UBound(TopicName)+1
               ReDim Preserve TopicName(nLen)
               TopicName(nLen) = Name
               ReDim Preserve TopicDescription(nLen)
               TopicDescription(nLen) = Description
            
 End Sub

</script>

0
 
LVL 5

Expert Comment

by:Yog
ID: 6242314
Go to IIS and check in th ISAPI filter if you have mapped the asp files to the asp.dll

cheers.
0
 
LVL 5

Expert Comment

by:Yog
ID: 6242318
oops sorry
0
 

Author Comment

by:sfern
ID: 6242334
Could you please be more explisit.
Could you give me paths..please

Thanks
0
 

Author Comment

by:sfern
ID: 6242341
how do i do that?
0
 
LVL 2

Expert Comment

by:Fenatu
ID: 6242343
I created a global.asa with the exact contents as yours then wrote a test page with the following code:

<%
Rooms = Application("TopicNames")
For i = 0 to UBound(Rooms)
Response.Write Rooms(i) & "<br>"
Next
%>

It displayed the names of the rooms, as expected.

Where is the ASP Chat package downloadable from? Perhaps there's a bug in their page.
0
 

Author Comment

by:sfern
ID: 6242349
It's called Adrenalin's ASP Chat v1.0.
It's a small zip file, but a cannot remember where
i downloaded it from.
If you want i can send it to you.
It's 23.3kb

0
 
LVL 2

Expert Comment

by:Fenatu
ID: 6242359
Sure. Email it to sentry07@yahoo.com
0
 

Author Comment

by:sfern
ID: 6242384
It's on the way..thanks
0
 
LVL 2

Expert Comment

by:Fenatu
ID: 6242415
I unzipped it and opened the default.asp. Having absolutely no problems on my end. Could you see the default rooms before you added yours?
0
IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

 

Author Comment

by:sfern
ID: 6242422
No, not at all.
Can it be a config problem?
0
 

Author Comment

by:sfern
ID: 6242427
shall i create a new vertual dir and try again?
0
 
LVL 2

Accepted Solution

by:
Fenatu earned 250 total points
ID: 6242438
In your IIS control panel, right click on the directory containing the ASPChat stuff and go to Properties. Look for "Application Settings". If there's a button that says "Create", click it. Then try running ASPChat again.
0
 

Author Comment

by:sfern
ID: 6242448
Is that in Control panel/administrative tools directory?
0
 
LVL 2

Expert Comment

by:Fenatu
ID: 6242452
Yeah. Should be. Internet Services or something like that. (Kinda rusty on my NT4 stuff)
0
 

Author Comment

by:sfern
ID: 6242455
On Administrative tools i've got:

1. Component Services
2. Computer Management
3. Data Sources (ODBC)
4. Event Viewer
5. Internet Services Manager
6. Local Security Policy
7. Performance
8. Personal Web Manager
9. Server Extentions
10. Services
11. Telnet Server Administration.

Now if i open Internet Services Manager i get:

1. Default Ftp Site
2. Default Web Site
3. Default SMTP Virtual Server.


In which should i look?

0
 
LVL 2

Expert Comment

by:Fenatu
ID: 6242464
Ok, click the plus next to Default Web Site. You should get a list of directories and virtual directories under it. And you said you created a virtual directory so the directory the ASP Chat is in should be under that. Then right click on it and go to Properties and do the Application Settings thing.
0
 

Author Comment

by:sfern
ID: 6242465
GREEEAAT you got it.
I didn't specify an application name.
Thanks a million and i'm apgrading my points,
for all your help.

THANX AGAIN
0
 

Author Comment

by:sfern
ID: 6242468
Thanx a lot for all your help :-)

sfern

0
 
LVL 2

Expert Comment

by:Fenatu
ID: 6242473
Not a prob. Enjoy your chat page. It's actually a pretty good looking chat "applet". Might have to use it, myself.
0
 

Author Comment

by:sfern
ID: 6242477
Hehehe :-)

Thanx Again

Bye
0

Featured Post

What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

Join & Write a Comment

Hello, all! I just recently started using Microsoft's IIS 7.5 within Windows 7, as I just downloaded and installed the 90 day trial of Windows 7. (Got to love Microsoft for allowing 90 days) The main reason for downloading and testing Windows 7 is t…
This demonstration started out as a follow up to some recently posted questions on the subject of logging in: http://www.experts-exchange.com/Programming/Languages/Scripting/JavaScript/Q_28634665.html and http://www.experts-exchange.com/Programming/…
It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.

757 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

23 Experts available now in Live!

Get 1:1 Help Now