It’s a Programmer Thing

It’s a Programmer Thing

One of the more time consuming portions of the project I’m currently undertaking is revamping several online forms for use between three schools. Forms like purchase requests, maintenance requests, paid leave of absence, the standard vanilla stuff you see with any organization. I had actually written the first incarnation of these forms back in high school, August 2006 to be exact (assuming I didn’t lie on the website). I used a combination of classic ASP and a Microsoft Access database. Yes, you heard right, an Access database. I actually had access to a MSSQL install but, seeing how I was still relatively new to ASP and databases in general, the thought probably never crossed my mind. It wasn’t until later when I started running into “Unspecified errors” and performance issues when I started regretting this decision.

Up until recently, the forms were running great – then the RAID array they were hosted on went south. The server admin wasn’t running backups so I thought I had lost them for good – but fortunately I managed to find an old archived backup from 2007 on a file server. Tonight I took a peek at the source for the first time in years and, after expecting to grimace at the sight of it, was surprisingly intrigued. It was one of my first “real” websites so I think I have more of a nostalgic connection to it than any other project I’ve taken on. When I see code like this,

Dim Conn, ConStr
Set Conn = Server.CreateObject("ADODB.Connection")
 
'Create the connection to the access database
ConStr = "DRIVER={Microsoft Access Driver (*.mdb)}; DBQ="
ConStr = ConStr & Server.MapPath("/WWW2.mdb")
 
Conn.Mode = 3
Conn.Open Constr
 
' Create TicketID
CurDay = Right("00" & day(now),2)
CurDay = CurDay & Ucase(MonthName(month(now), true)) & Right(year(now),2)	
 
sqlGetTicketNo = "SELECT MAX(Ticket_ID)AS TNUM FROM Tickets WHERE (((Ticket_ID) LIKE '%" & CurDay & "'))"
 
Set rsGetTicketNo = Conn.Execute(sqlGetTicketNo)
IF isNULL(rsGetTicketNo("TNUM")) Then
 GetTicketNo = "0001-" & CurDay
ELSE
 CurTicketNo = rsGetTicketNo("TNUM")
 NewTicketNo = trim(left(CurTicketNo,instr(CurTicketNo, "-")-1))
 NewTicketNo = "00000" & (NewTicketNo + 1)
 GetTicketNo = Right(NewTicketNo,4) & "-" & CurDay
End IF
rsGetTicketNo.Close

Not only does it make me wonder what I was thinking to come up with a mess like that, but it also brings back somewhat fond memories of late nights with Google and brief cursing.

But, I digress. What seems to be plain old boring code to you oddly strikes me as meaningful. Perhaps it’s just a programmer thing? A certain attachment to our first creations? As it turns out, as far as web languages go, I did not continue on much with ASP. I dabbled a bit with ASP.NET, but eventually moved towards PHP at the persuasion of a few friends and the need to learn it in order to understand and modify IP.Board. I imagine the next couple of weeks will be amusing as I take a closer look at some of the forms I wrote while I port them over to my PHP framework.