<% 'Declare variables Dim sSQL, guestupdate, iID Dim fname, location, email, comments Dim message_status fname = Replace(Request.form("name"),"'","''") location = Replace(Request.form("location"),"'","''") email = Request.form("email") comments = Replace(Request.form("comments"),"'","''") message_status = Request.form("active") 'sEmail = Replace(Request.form("txtEmail"),"'","''") 'sHeard_About_Website = Request.form("selHeard_About_Website") iID=Request.form("ID") 'receive the hidden form ID 'build the SQL statement sSQL = "UPDATE guests SET name='" & fname & "', location='" & location & "'," & _ "email='" & email & "', comments='" & comments & "',active='" & message_status & "' WHERE ID=" & iID 'Create an instance of an ADO connection object Set guestupdate=Server.CreateObject("ADODB.Connection") 'Open the connection guestupdate.Open(Conn) 'Execute the SQL guestupdate.execute(sSQL) 'Close the resources and free up resources guestupdate.Close Set guestupdate=Nothing Response.write "
Record updated.
" %>
© Copyright 2007