Retrieving data via an HTML document through IIS

How do you retrieve data in a specific SQL 2000 (Server) table via an HTML document passing through an IIS Web server (or where is there information on this - I can connect & retrieve via VB6)?

    Requires Free Membership to View

You write an ASP script that issues a select * against the table you want. Below is an example from one of my websites. It isn't pretty and there aren't any vast secrets in here either.

 <%@ Language=VBScript %> <% Option Explicit Response.Buffer = true '************************************************************ 'Page Name: /checklist.asp 'Purpose: Dynamically generates a series checklist 'Creation Date: 12/14/2001 'Author: Michael Hotek - mhotek@mssqlserver.com 'C Copyright 2001 mhotek.com. All Rights Reserved. '************************************************************ 'Modifications: ' Author: ' Date: ' Action: '************************************************************ 'Dim variables here DIM connCatalog DIM strSQL DIM rsRecordSet Set connCatalog = Server.CreateObject("ADODB.Connection") connCatalog.Open Application("strConn") strSQL = "select series from zlk_series " _ & " where seriesid = " & request.querystring("series") set rsRecordSet = connCatalog.execute(strSQL) %> <html> <head> <META NAME="description" CONTENT="Easton Press collector's edition libraries. Checklist of <% while not rsRecordSet.eof response.write(rsRecordSet.fields("series").value) rsRecordSet.movenext wend%>"> <title>mhotek.com: Easton Press checklist of <% rsRecordSet.movefirst while not rsRecordSet.eof response.write(rsRecordSet.fields("series").value) rsRecordSet.movenext wend%> </title>

 

For More Information

This was first published in March 2002

Join the conversationComment

Share
Comments

    Results

    Contribute to the conversation

    All fields are required. Comments will appear at the bottom of the article.