Q

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

Dig deeper on Microsoft SQL Server Installation

Pro+

Features

Enjoy the benefits of Pro+ membership, learn more and join.

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.

0 comments

Oldest 

Forgot Password?

No problem! Submit your e-mail address below. We'll send you an email containing your password.

Your password has been sent to:

SearchBusinessAnalytics

SearchDataCenter

SearchDataManagement

SearchAWS

SearchOracle

SearchContentManagement

SearchWindowsServer

Close