home *** CD-ROM | disk | FTP | other *** search
/ Chip 1998 February / CHIP_2_98.iso / software / pelne / optionp / iis4_06.cab / samp3unt.asp < prev    next >
Text File  |  1997-10-15  |  3KB  |  40 lines

  1.  <% If Request("DontFrame")<>1 Then Response.Redirect "/iissamples/sdk/asp/docs/SampFram.asp?ovfile=/iishelp/iis/htm/sdk/samp3unt.asp&srcfile=Database/SimpleQuery" %>
  2. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
  3. <HTML>
  4. <HEAD>
  5. <META HTTP-EQUIV="Content-Type" Content="text-html; charset=Windows-1252">
  6. <title>Simple Query</title>
  7. <script language="JavaScript">
  8.  
  9.     szNavVersion = navigator.appVersion
  10.  
  11.     if (navigator.appName == "Microsoft Internet Explorer") {
  12.     if (szNavVersion.indexOf ("4.") >= 0) {
  13.         document.writeln('<link rel="stylesheet" type="text/css" href="/iishelp/common/spidie4.css">');
  14.     } else {
  15.         document.writeln('<link rel="stylesheet" type="text/css" href="/iishelp/common/spidie3.css">');
  16.     }
  17.     }
  18.     else if (navigator.appName == "Netscape") {
  19.     document.writeln('<link rel="stylesheet" type="text/css" href="/iishelp/common/spidie4.css">');
  20.     }
  21.     else {
  22.     document.writeln('<link rel="stylesheet" type="text/css" href="/iishelp/common/spidie3.css">');
  23.     }
  24.  
  25. </script>
  26. <META NAME="DESCRIPTION" CONTENT="Internet Information Server reference information"></HEAD>
  27. <BODY BGCOLOR=#FFFFFF TEXT=#000000>
  28. <font face="Verdana, Arial, Helvetica">
  29. <h3><a name="_simple_query"></a>Simple Query</h3>
  30. <p>
  31. Databases can be very complicated systems, and data access tools must be powerful and responsive enough to accomplish the often difficult and exacting tasks that you require. However, it is equally important to you that simple database access tasks be easy to accomplish. </p>
  32. <p>
  33. This sample demonstrates how ADO provides just such a solution. The goal of this sample application is to retrieve a small recordset from a Microsoft® Access database, and print the results. The first step is to create an instance of the <b>Connection</b> object, using the <b>Server.CreateObject</b> method. The sample uses the <b>Connection</b> object instance to open the ODBC data source, then uses the <b>Connection</b> instance again to execute a SQL <b>SELECT</b> command to retrieve all the records from the Authors table. The script finishes by iterating through the returned recordset collection and displaying the results. Afterwards, both the recordset and ODBC data source connection are closed. It's that simple.</p>
  34. <p>
  35. <b>Note</b>  ODBC must be properly configured on the server before this sample will run properly. </p>
  36. <hr class="iis" size="1">
  37. <p align="center"><em><a href="/iishelp/common/colegal.htm">© 1997 by Microsoft Corporation. All rights reserved.</a></em></p>
  38. </BODY>
  39. </HTML>
  40.