<% If Request("DontFrame")<>1 Then Response.Redirect "/iissamples/sdk/asp/docs/SampFram.asp?ovfile=/iishelp/iis/htm/sdk/samp9uk3.asp&srcfile=Database/Update" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
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>
<p>
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>
<p>
<b>Note</b> ODBC must be properly configured on the server before this sample will run properly. </p>