Boilerplate Classic ASP Page

Boilerplate Classic ASP Page

This post is part of a project to move my old reference material to my blog. Before 2012, when I accessed the same pieces of code or general information multiple times, I would write a quick HTML page for my own reference and put it on a personal site. Later, I published these pages online. Some of the pages still get used and now I want to make them available on my blog.

Photo by [Dakota Roos]( by Dakota Roos

Instead of starting a new page from scratch, use this boilerplate to get started. All of the groundwork is laid out for a simple ASP page that uses a SQL server database. You will see references to bootstrap.css and jquery.js. You can either download these from and or you can use a CDN.



<% Option Explicit %>
<!doctype html>
<html lang="en">
    <meta charset="utf-8">
    <meta http-equiv="x-ua-compatible" content="ie=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">


<link rel="stylesheet" href="css/bootstrap.css">

  <!-- #include file="db-connect.asp" -->

    <div class="container">

    <script src="js/jquery.js"></script>
    <script src="js/main.js"></script>

  <% objConn.Close %>


Database Connection


  Dim objConn
  Set objConn = Server.CreateObject("ADODB.Connection")
  objConn.ConnectionString = "Provider=SQLOLEDB; Data Source=(local); Database=[DATABASE]; User ID=[USER ID]; Password=[PASSWORD]"