Writing Your First ASP Application ( Quick Start ) - Additional Enhancements
(Page 8 of 8 )
That completes the rudimentary application. This code will functionally achieve the results that we started out with. For the sake of readability, it has been left very simple. If you were to wish to use this code in an actual application, there are many enhancements you could and some that you really should add. For example:
• Error handling for database connectivity issues.
• Unique identification column in the UsersOnline table. As the code is now, if there are two people with the name “Rich” logged in, when the first one logs out of the system, both of them are removed from the table.
• Login times could be also saved and displayed.
• Application_OnStart and Application_OnEnd functions could be utilized to clean out the UsersOnline table when the server stops and starts again.
• Database logic could be fully enclosed within include files.
• Logic could be added to the ShowUsers subroutine to suppress the current user’s name, so you wouldn’t see your own name in the list.
So there you have it. We have just designed and created an actual ASP application. Of course, what we made does not encompass a full website, but it adds the ability to have a list of active users on your website. I hope that reviewing this code helps those of you who are just getting started in ASP to better visualize the concepts, and puts you on the road to creating your own ASP applications a little quicker.
About the author:
Rich Smith owns and operates
Jamsoft Development, a programming firm who specializes in custom systems for small businesses.