<!--#include file="te_config.asp"-->
<%

	'Check if the user approved delete and has permissions to delete
	if (request("sure") <> "") and bRecDel then

		lConnID = request("cid")
		sTableName = request("tablename")
		sFieldName = request("fld")
		sFieldValue = request("val")
		lFieldType = CLng(request("fldtype"))
		
		OpenRS arrConn(lConnID)

		'Change: Field Type Check
		'By Hakan Eskici on Nov 02, 2000
		select case lFieldType
			case adDate, adDBDate, adDBTime, adDBTimeStamp
				sWhere = " WHERE [" & sFieldName & "]=#" & sFieldValue & "#"
			case adTinyInt, adSmallInt, adInteger, adBigInt, adUnsignedTinyInt, adUnsignedSmallInt, adUnsignedInt, adUnsignedBigInt, adSingle, adDouble, adCurrency, adDecimal, adNumeric, adBoolean
				sWhere = " WHERE [" & sFieldName & "]=" & sFieldValue
			case else
				sWhere = " WHERE [" & sFieldName & "]='" & sFieldValue & "'"
		end select
		sSQL = "delete from [" & sTableName & "]" & sWhere
		conn.execute sSQL
		response.redirect "te_showtable.asp?cid=" & lConnID & "&tablename=" & sTableName & "&ipage="  & request("ipage")
	end if

%>
<!--#include file="te_header.asp"-->
<table border=0 cellspacing=1 cellpadding=2 bgcolor = "#ffe4b5" width=100%>
	<tr>
		<td class="smallertext">
			<a href="index.asp">管理首页</a> <a href="te_admin.asp">编辑页面</a> <a href="te_listtables.asp?cid=<%=request("cid")%>"><%=arrDesc(request("cid"))%></a> <a href="te_showtable.asp?cid=<%=request("cid")%>&tablename=<%=server.urlencode(request("tablename"))%>&ipage=<%response.write(request("ipage"))%><% if bQuery then response.write("&q=1") end if %>">表格 [<%=request("tablename")%>]</a> 删除记录
		</td>
		<td class="smallerheader" width=130 align=right>
		<%
		if bProtected then 
			response.write session("teFullName")
			response.write "<a href=""te_logout.asp"">(退出)</a>" 
		end if
		%>
		</td>
	</tr>
</table>
<br>

	
<p class="smallerheader">你确定要删除这个记录?(<font color="#FF0000">请慎重操作不可恢复</font>)</p>
	<a href="te_deleterecord.asp?<%=request.querystring%>&sure=1">是</a>&nbsp;
	<a href="<%=request.servervariables("http_referer")%>">否</a>
			
<!--#include file="te_footer.asp"--> 

