РР Р编写的add_data.asp代码为:Р<%Рtid = Request.Form("txtID") Рtname=Request.Form("txtName") Рsex = Request.Form("sex")Рtpid = Request.Form("txtPID")Рsalar" /> РР Р编写的add_data.asp代码为:Р<%Рtid = Request.Form("txtID") Рtname=Request.Form("txtName") Рsex = Request.Form("sex")Рtpid = Request.Form("txtPID")Рsalar" />

全文预览

北京电大2009年7月网络编程技术ASP试卷A(已打印)

上传者:科技星球 |  格式:doc  |  页数:3 |  大小:40KB

文档介绍
reset" name="reset" value="重置">Р</form>Р</body> </html>Р编写的add_data.asp代码为:Р<%Рtid = Request.Form("txtID") Рtname=Request.Form("txtName") Рsex = Request.Form("sex")Рtpid = Request.Form("txtPID")Рsalary = Request.Form("txtSalary") (2分)РSet conn = Server.CreateObject("ADODB.Connection") РSet rs = Server.CreateObject("ADODB.RecordSet")Рconn.Open "Driver={SQL Server};Server=202.10.10.1;UID=sa; PWD=xyz123; database=TESTDB" (3分)Рsql = "select * from Worker where 工号='"&tid&"'"Рrs.Open sql,conn,adOpenKeySet,adLockOptimistic (3分)РIF rs.EOF AND BOF THENР rs.AddNewР rs.Fields("工号") = tid Р rs.Fields("姓名") = tnameР rs.Fields("性别") = sexР rs.Fields("身份证号") = tpidР rs.Fields("工资") = salary Р?rs.UpdateРELSEР?Response.Write "该工号的记录已存在"РEND IFРrs.Close (2分)РSet rs = NothingРconn.CloseРSet conn = NothingР%>

收藏

分享

举报
下载此文档