userbatch.asp

来自「这是我在大三的《asp程序设计教程》的课程设计」· ASP 代码 · 共 37 行

ASP
37
字号
<!-- #include file="conn.asp" -->
<!-- #include file="usertop.asp" -->
<html>
<head>
<link rel="stylesheet" href="usercommon.css" type="text/css">
</head>
<body>
<br>
<br>
<br>
<%
'判断用户是否具有添加数据的权限
if Session("level") < 3 then
	Response.write"<br><br><br><br><br><br><font color=red>您没有操作权限或连接已经超时,请重新登录!</font>"
	Response.end
end if
On Error Resume next
Set rs=Server.CreateObject("adodb.recordset")
sql="bulk insert t_user from 'D:\Myweb\usertest.txt' with (FIELDTERMINATOR = '	',ROWTERMINATOR = '\n')"
conn.begintrans
conn.execute(sql)
if Err.number=0 then
	response.write"<font color=red>添加数据成功!</font>"
else
	conn.rollbacktrans
	response.write"<font color=red>添加数据失败!此用户组可能已经存在或无有效数据,请查核后添加!</font>"
end if
if isObject(rs) then
	rs=nothing
end if
if isObject(conn) then
	conn.close
end if	

%>
</body>
</html>

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?