Problem solve Get help with specific problems with your technologies, process and projects.

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)?

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 last published in March 2002

Dig Deeper on Microsoft SQL Server Installation

Have a question for an expert?

Please add a title for your question

Get answers from a TechTarget expert on whatever's puzzling you.

You will be able to add details on the next page.

Start the conversation

Send me notifications when other members comment.

By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Please create a username to comment.