do while……loop循环删除记录

<%@LANGUAGE="VBSCRIPT"CODEPAGE="936"%>

<!DOCTYPEhtmlPUBLIC"-//W3C//DTDXHTML1.0Transitional//EN""http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<htmlxmlns="http://www.w3.org/1999/xhtml">

<head>

<metahttp-equiv="Content-Type"content="text/html;charset=gb2312"/>

<title>rs_del.asp(dowhile……loop循环删除记录)</title>

</head>



<body>

<%

setconn=server.CreateObject("adodb.connection")

conn.open"provider=sqloledb;datasource=localhost;database=employee;uid=sa;password="



setrs=server.CreateObject("adodb.recordset")

source="table2"

rs.opensource,conn,1,3



dowhilenotrs.eof

ifrs("序号").value>=16then

rs.delete

endif

rs.movenext

loop

rs.updatebatch

rs.close

rs.open"select*fromtable2",conn,1,3



response.write"<tableborder=1width=80%\>"

response.write"<tralign=center>"

fori=0tors.fields.count-1

response.write"<td>"&rs(i).name&"</td>"

next

response.write"</tr>"



dowhilenotrs.eof

response.write"<tralign=center>"

fori=0tors.fields.count-1

response.write"<td>"&rs(i).value&"</td>"

next

rs.movenext

response.write"</tr>"

loop

response.write"</table><br>"



rs.close

setrs=nothing

conn.close

setconn=nothing

%>

</body>

</html>

你可能感兴趣的:(html,XHTML,VBScript,asp,OpenSource)