Skip to content

Instantly share code, notes, and snippets.

@JohnMGant
Last active August 1, 2019 13:22
Show Gist options
  • Select an option

  • Save JohnMGant/e317c5f795ab2e55d7b32095c737f04d to your computer and use it in GitHub Desktop.

Select an option

Save JohnMGant/e317c5f795ab2e55d7b32095c737f04d to your computer and use it in GitHub Desktop.
Example of classic ASP spaghetti code
<html>
<body>
<table>
<%
set conn=Server.CreateObject("ADODB.Connection")
conn.Provider="Microsoft SQL Server"
conn.Open "Server=SQLPROD;Database=HR;UserID=SuperDuperAdmin;Password=ABC123!!!"
set rs=Server.CreateObject("ADODB.recordset")
sql="SELECT ID, Name, FavoriteColor " &
"FROM Employees " &
"WHERE LastName LIKE '" & Request.QueryString("lastName") & "%' " &
"ORDER BY LastName, FirstName"
rs.Open sql, conn
%>
<tr><th>ID</th><th>Name</th><th>Favorite Color</th></tr>
<%do until rs.EOF%>
<tr><td>rs!ID</td><td>rs!Name</td><td>rs!FavoriteColor</td></tr>
<%loop%>
</table>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment