<%@ LANGUAGE = VBScript %> <% Option Explicit %> Update Database Update Database

<% Dim oConn ' object for ADODB.Connection obj Dim oRs ' object for output recordset object Dim curDir ' Directory of authors.mdb file ' Map authors database to physical path curDir = Server.MapPath("\iissamples\sdk\asp\database\authors.mdb") ' Create ADO Connection Component to connect with sample database Set oConn = Server.CreateObject("ADODB.Connection") oConn.Open "DBQ="& curDir &";Driver={Microsoft Access Driver (*.mdb)};DriverId=25;FIL=MS Access;" ' Create ADO Recordset Component, and associate it with ADO connection Set oRs = Server.CreateObject("ADODB.Recordset") Set oRs.ActiveConnection = oConn ' Get empty recordset oRs.Source = "SELECT * FROM authors" oRs.CursorType = adOpenStatic ' use a cursor other than Forward Only oRs.LockType = adLockOptimistic ' use a locktype permitting insertions oRs.Open ' Change values in first record found oRs("Author").Value = "Scott Guthrie" oRs("Yearborn").Value = 1975 oRs.Update %> Changed Author: <%= oRs("Author") %>, <%= oRs("Yearborn") %>