Ask the Expert

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

There are Comments. Add yours.

 
TIP: Want to include a code block in your comment? Use <pre> or <code> tags around the desired text. Ex: <code>insert code</code>

REGISTER or login:

Forgot Password?
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
Sort by: OldestNewest

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: