大家帮我该下这段代码吧~~
求求帮下拉~~
我知道这断代码很多错误~~~就当帮帮初学者~
先说声:谢谢
<%
Dim Conn
Set Conn = Server.CreateObject("ADODB.Connection")
Conn.Open "Driver={Sql Server};Server=(local);UID=sa;PWD=;Database=db_schoolcomputer"
%>
<%if (request("tabname")<> "") then tabname=request("tabname")%>
<%
if (request("selected")<> "") then tabname=request("selected")
del="delete from "&tabname
conn.execute(del)
%>
<script language="javascript">
alert("<%=tabname%>已经删除")
</script>
<%end if%>
<script language="javascript">
function bb(){
var tabname=form.selectid.value
window.location.href="index.asp?tabname="+tabname
</script>
<script language="javascript">
function cc(){
window.location.href="index.asp"
</script>
<table width="335" border="0" cellpadding="0" cellspacing="0" align="center">
<form name="selected" method="post" action="index.asp">
<tr>
<td width="335" height="38" valign="top" align="center">
<select name="selected" id="selected" onchange="bb()">
<option selected>选者表单</option>
<%
set rs=server.CreateObject("adodb.recordset")
sql="select name from sys where xtype='u'"
rs.open sql,conn,1,3
for i=1 to rs.recordcount
%>
<option value="<%=rs("name")%>"<%if rs("name")=tabname then response.write("selected")%>><%=rs("name")%></option>
<%
rs.movenext
next%>
</select>
</td>
</tr>
<%if (request("tabname")<> "") then tabname=request("tabname")%>
<%
set rs1=server.CreateObject("adodb.recordset")
sql="select top 5 from "&tabname
rs1.open sql,conn,1,3
if not(rs1.eof and rs1.bof) then
%>
<tr>
<%rs1.fields.count-1=Ecount
if Ecount>5 then
Ecount=4
end if%>
<%for i=1 to Ecount%>
<td height="25" valign="top"><%=rs1.fields(i).name%></td>
<%next%>
</tr>
<tr>
<%for ii=1 to rs1.recordcount%>
<%for i=1 to Ecount%>
<td height="25" valign="top"><%=rs1.fields(i).value%></td>
<%next%>
</tr>
<%rs1.movenext
next%>
<tr>
<td height="25" valign="top"><!--DWLayoutEmptyCell--> </td>
</tr>
<tr>
<td height="25" valign="top"><!--DWLayoutEmptyCell--> </td>
</tr>
<tr>
<td height="25" valign="top"><!--DWLayoutEmptyCell--> </td>
</tr>
<tr>
<td height="37" valign="top" align="conter">
<div align="center">
<input name="sub" type="submit" class="button" value="删除">
<input name="sub1" type="button" class="button" value="取消" onclick="cc()">
</div></td>
</tr>
<%end if
end if%>
</form>
</table>