電子工業出版社 SHING HOUSE DF ELECTRONCS strSqlSelectUsers="SELECT* FROM users WHERE username"& Request Form("txtUser Name") rsUsers. Open strSqlselectUsers, connDemo, 1, 3 接受表单输入数据,写入数据库 rsUsers("username"REquest Form(txtUserName") rs Users("phone"REquest Form("txtPhone") rsUsers("email"REquest Form(txtEmail") rsUsers("resume"REquest Form("txtResume") rsUsers. close Set rsUsers=Nothing 显示执行结果 msg="编辑成功!ln" Response. Write("<scriptalert(& msg &"), history. go-1)/script> " Response. End 建立一个到数据源的连接 strDSN="ProviderMSDASQL, DRIVER=ISQL Server): SERVER=127.0.0.1; DATABASE=Demo UID=chen, PWD=123 Set connDemo =Server CreateObject("ADODB Connection") connDemo. Open strDSN 建立记录集,存放查询结果 Set rsUsers= Server CreateObject("ADODB. Recordset") strSqlSelectUsers="SELECT*FROM users WhEre id="& id rsUsers. Open strSqlselectUsers, connDemo, 3, 3 <html <head> <metahttp-equiv="content-type"content="Text/html;charset=gb2312> title>基础模块“修改记录”之“修改记录”<lile> <body bgcolor"#COCOCO"> < font face="华文行楷”sie="6">修改记录</ont><hl> <hp> <h3>请修改记录数据:<h3>strSqlSelectUsers="SELECT * FROM users WHERE username='" & Request.Form("txtUserName") & "'" rsUsers.Open strSqlSelectUsers, connDemo,1,3 '接受表单输入数据,写入数据库 rsUsers("username")=Request.Form("txtUserName") rsUsers("phone")=Request.Form("txtPhone") rsUsers("email")=Request.Form("txtEmail") rsUsers("resume")=Request.Form("txtResume") rsUsers.Update rsUsers.Close Set rsUsers=Nothing '显示执行结果 Dim msg msg="编辑成功!\n" Response.Write("<script>alert('" & msg & "');history.go(-1)</script>") Response.End Else '建立一个到数据源的连接 strDSN="Provider=MSDASQL;DRIVER={SQL Server};SERVER=127.0.0.1;DATABASE=Demo;UID=chen;PWD=123" Set connDemo = Server.CreateObject("ADODB.Connection") connDemo.Open strDSN '建立记录集,存放查询结果 Set rsUsers = Server.CreateObject("ADODB.Recordset") strSqlSelectUsers="SELECT * FROM users WHERE id=" & id & "" rsUsers.Open strSqlSelectUsers, connDemo,3,3 End If %> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=gb2312"> <title>基础模块“修改记录”之“修改记录”</title> </head> <body bgcolor="#C0C0C0"> <p> <font face="华文行楷" size="6">修改记录</font></h1> </p> <h3>请修改记录数据:</h3>