home *** CD-ROM | disk | FTP | other *** search
/ Chip 1998 February / CHIP_2_98.iso / software / pelne / optionp / iis4_06.cab / samp9uk3.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/samp9uk3.asp&srcfile=Database/Update" %>
  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>Update Records</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="_update_records"></a>Update Records</h3>
  30. <p>
  31. This example demonstrates how your application can update existing records using ADO. <b>CreateObject</b> is used to create an instance of the <b>Connection</b> object, which in turn is used to open a connection to the ODBC data source. <b>CreateObject</b> is used again, this time to create an empty <b>Recordset</b> object. The <b>ActiveConnection</b> property is set to refer to the new <b>Connection</b> object. </p>
  32. <p>
  33. The new recordset is then configured. The <b>Recordset.Source</b> property specifies the SQL string to be used, and the new recordset is opened. For the purposes of this sample, it is assumed that the very first record found is the record that needs to be updated. The strings Author and Yearborn are used as indexes into the <b>Recordset</b> object, and the <b>Value</b> property is used to set the values of each of those fields to a new value. The <b>Recordset.Update</b> method is then called to write the new information back to the database. </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.