Welcome to weblogs.com.pk Sign in | Join | Help

Beautiful Code From A Beautiful Client

Consider you are given a task to make a portion of a website; all you need to do is to create couple of pages to show the result of an exam. You are expecting lot of sudden users who will be coming to the site to check the results.

 

Your stakeholder has arranged a web host who has offered ASP, ASP.NET and PHP platforms for server side programming, and SQL Server and MS Access for database.

 

The institution you are going to represent by producing this site is also involved in computer education. It is natural that the audience is expecting good quality code.

 

The portion of the code they come up with is:

 

<%

..

set objconn = server.CreateObject ("ADODB.Connection")

objconn.ConnectionString  = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & server.MapPath("somefile.mdb")

objconn.Open

set deptid = objconn.Execute ("select * from deptdes order by deptid") %>

<html>

….

 

You will certainly expect objconn.Close and/or set objconn=nothing somewhere in the page after objconn.Open, right?

 

What will be your reaction, when you will not find any such thing?

 

This is not the first time, this is the third year in the row, we have been explaining to them, that For God sake; always close the f*&$@& database connection!

Published Thursday, April 8, 2004 11:47 PM by khurram

Comments

# re: Beautiful Code From A Beautiful Client

Friday, April 9, 2004 12:41 AM by FarazTruehttp
From the level of your frustration, I feel that you own or are in some way responsible for maintaining the host. I encourage you to declare war on this act of terrorism, and deploy your troops to liberate the management, students and the fair maidens of the University from these "evil" programmers who take great pleasure in the agony of server administrators and write code with no database closing statements. I'm sure these programmers are linked to Saddam's elite-coders group.

# re: Beautiful Code From A Beautiful Client

Friday, April 9, 2004 11:58 AM by Khurram AzizT
Lol!

I guess I crossed the limit. I should remove the direct names from the above post!

Anyways, with our assistance, and little rigidness, they have fixed the code, and their site is up and running again!

My management is kind enough and has approved budget to upgrade our web servers to Win2k3 and using multiple application pool facility of IIS6, our administrators will have option to throttle resources for such applications.
New Comments to this post are disabled