Click here to Skip to main content
15,894,646 members
Articles / Web Development / IIS

A db grid control using ASP

Rate me:
Please Sign up or sign in to vote.
4.74/5 (34 votes)
27 Aug 20012 min read 528.3K   11K   88  
A grid control for ASP written in JavaScript to display recordsets.
<script language=javascript runat=server>
function Out(s) {
	return Response.Write(s);
}

function DebugOut(s) {
	return Out("<div style=\"background-color:#FFC0C0; border: 1px solid black; padding: 4px; margin:2px\">" + s + "</div>");
}

function PageHeader(Title) {
	Out("<html>\n");
	Out("<head>\n");

	Out("<style>\n");
	Out("body, td, input, select, textarea { font-family: verdana; font-size: 8pt}\n");
	Out("body { background-color: #FFFFE0 }\n");
	Out("hr { height: 1px; color: #000000 }\n");
	Out("</style>\n");
	Out("<link rel=\"stylesheet\" type=\"text/css\" href=\"dblib.css\" />\n");

	Out("<title>" + Title + "</title>\n");
	Out("</head>\n");
	Out("<body>\n");
}

function PageFooter() {
	Out("<hr>Visit <a href=\"http://www.bhenden.org/\">www.bhenden.org</a> for contact information and the latest version.");
	Out("</body>\n");
	Out("</html>\n");
}

function CreateConnection() {
	var Conn = Server.CreateObject("ADODB.Connection");
	Conn.Open("DRIVER={Microsoft Access Driver (*.mdb)};DBQ=" + Server.MapPath("northwind.mdb"));
	Conn.CursorLocation = adUseClient;
	return Conn;
}
</script>

<script language=vbscript runat=server>
function jsFormatDateTime(dato,fmt)
	jsFormatDateTime = FormatDateTime(CDate(dato),fmt)
end function
</script>

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here


Written By
Web Developer
Norway Norway
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions