ASP
  Home arrow ASP arrow Page 7 - Writing Your First ASP Application ( Quick...
ASP Free Forums 
.NET  
ASP  
ASP Code  
ASP.NET  
ASP.NET Code  
BrainDump  
C#  
Code Examples  
Database  
Database Code  
IIS  
Microsoft Access  
MS SQL Server  
Visual Basic.NET  
Windows Scripting  
Windows Security  
XML  
ASP Web Hosting  
ASP.NET Web Hosting 
Mobile Linux 
App Generation ROI 
Windows Web Hosting
 
IBM® developerWorks 
Sun Developer Network 
Weekly Newsletter
 
Developer Updates  
Free Website Content 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us Get Paid 
Request Media Kit
Contact Us 
Site Map 
Privacy Policy 
Support 
 USERNAME
 
 PASSWORD
 
 
  >>> SIGN UP!  
  Lost Password? 
ASP

Writing Your First ASP Application ( Quick Start )
By: Rich Smith
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 4 stars4 stars4 stars4 stars4 stars / 82
    2003-08-06

    Table of Contents:
  • Writing Your First ASP Application ( Quick Start )
  • Users On Your Website
  • Dissecting The Needs For The Application
  • Login Page
  • Showing The List Of Users
  • Simplifying The Code
  • Removing Users From The List
  • Additional Enhancements

  • Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      Del.ici.ous Digg
      Blink Simpy
      Google Spurl
      Y! MyWeb Furl
    Email Me Similar Content When Posted
    Add Developer Shed Article Feed To Your Site
    Email Article To Friend
    Print Version Of Article
    PDF Version Of Article
     
     
    ADVERTISEMENT


    Writing Your First ASP Application ( Quick Start ) - Removing Users From The List


    (Page 7 of 8 )

    Now we have a way to add users to the list, and to show the list of users on any web page. But at this point, we have not discussed a way to remove users from our list. Without removing the users, their names would stay on the list forever.

    In order to remove users from the list, we will need to utilize the GLOBAL.ASA file. I am not going to go into great detail about the features of this file in this article. One of the features of the GLOBAL.ASA is the ability to recognize when a user’s session ends. This can be from the user choosing an option to logout of the system, or from a system-defined timeout.

    Here is the GLOBAL.ASA for this:


    <SCRIPT language=vbscript runat="server">

    Sub Session_OnEnd

    dim conn
    dim strsql

    ‘ Create a SQL statement to insert the name into our table
    strsql 
    "select UserName from UsersOnline”

    ‘ Open the database using our DSN
    strconn = “DSN=UserBase”

    set conn = server.createobject("
    adodb.connection")
    conn.open strconn

    ‘ Use the session variable to delete the user from the table
    strsql = “delete from UsersOnline where UserName = “ & chr(39) & _
    Session(“UserName”) & chr(39)

    conn.execute strsql

    conn.close
    set conn = nothing

    End Sub

    As you can see, I used the session variable that was created in the dologin.asp page to delete the user from the table when the session ends.

    More ASP Articles
    More By Rich Smith


     

    ASP ARTICLES

    - Using MySQL with ASP
    - ADO for the Beginner
    - ADO.NET 101: Data Rendering with a DataGrid ...
    - Introducing SoftArtisans OfficeWriter 3.0 En...
    - Getting Remote Files With ASP
    - The Real Basics of Functions in ASP
    - Enhancing Readability with ASP
    - Mimicking PHP's String Formatting Functions
    - Windows Server Hacks 12, 77, and 98
    - How to Sort a Multi-Dimensional Array
    - Developing an Information Management Tool wi...
    - What are Active Server Pages?
    - Getting Remote Pages with ASP
    - FTP’ing Files with ASP
    - Apply Single-Sign-On to Your Application





    © 2003-2008 by Developer Shed. All rights reserved. DS Cluster 5 hosted by Hostway
    Stay green...Green IT