批量录入提交的问题,在线等!

crazygjg 2006-02-22 09:17:44
admin_add1.asp页面
<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<!--#include file="conn.asp"-->
<%
if session("admin_name")="" then
response.Redirect("admin_login.asp")
end if
%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>填加信息</title>
<link href="sty.css" rel="stylesheet" type="text/css">
</head>
<%
dim inf_id

%>

<body class="font1">
<center>
<table width="360" border="0" cellpadding="0" cellspacing="3" class="font1">
<form action="admin_insert.asp" method="post">
<tr>
<td width="1%" rowspan="2"> </td>
<td width="98%"><%=inf_id%>点卡种类: <input name="GID" type="text" id="GID" size="27">

  </td>
<td width="1%" rowspan="2"> </td>
</tr>
<tr>
<td height="23">卡    号: <input name="CardNo" type="text" id="CardNo" size="27">
</td>
</tr>
<tr>
<td> </td>
<td> 密码: <input name="PWD" type="text" id="PWD" size="27">
<p>
<input type="submit" name="Button" value="添加" >
</p>
</td>
<td></td>
</tr>
</form>
</table>
</center>

</body>
</html>

admin_insert.asp页面
<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<!--#include file="conn.asp"-->
<%
Response.Buffer=true
dim rs,sql
sql="select * from GoodsMX where id=-1"
set rs=server.createobject("adodb.recordset")
rs.open sql,conn,1,3
rs.Addnew
if cstr(request("GID"))<>"" then
rs("GID")=request("GID")
end if
if cstr(request("CardNo"))<>"" then
rs("CardNo")=cstr(request("CardNo"))
end if
if cstr(request("PWD"))<>"" then
rs("PWD")=cstr(request("PWD"))
end if
rs.update

Response.Write("<script>alert('添加成功!');</script>")

rs.close : conn.close
set rs=nothing : set conn=nothing
response.Redirect("Admin_add1.asp") '"inf_check.asp?inf_id="+inf_id+"&r="+r+"&r1="+r1)
%>

conn.asp页面
<%
option explicit
Server.ScriptTimeOut=5000
response.Buffer=true
dim conn,connstr
set conn=server.createobject("adodb.connection")
connstr = "Provider=Microsoft.Jet.Oledb.4.0;data source="&server.mappath("remd5.asp")

conn.open connstr
If Err Then
err.Clear
Set Conn = Nothing
Response.Write "数据库连接出错,请检查连接字串。"
Response.End
End If
%>
=====================================================================
现在想做成批量录入提交,达到如下页面效果
<!--#include file="conn.asp"-->
<%set rs=server.createobject("adodb.recordset")
if session("admin_rank")<>1 and session("admin_rank")<>4 then
response.write("<script>alert('您无权查看本页,SORRY!');window.location=('login.asp')</script>")
response.end
end if
if request("hw_id")<>"" then
hw_id=int(request("hw_id"))
end if
%>
<html>

<head>
<link rel="stylesheet" type="text/css" href="css.css">
<meta http-equiv="Content-Language" content="zh-cn">
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>欢迎进入后台管理</title>
</head>
<body style="background-color: #F0FBF1">

<table border="0" width="650" cellpadding="2" height="375" cellspacing="1">

<tr>
<td height="227" width="651" valign="top">
<p align="center" style="margin-top: 7; margin-bottom: 7"> <p align="left" style="margin-left: 50">卡号密码输入框,示例abcdefg
123456,每行一个卡号+空格(分隔符)+密码。
<div align="center">
<center> <form name="Form1" method="post" action="admin_cardsaddsave.asp">
<table border="0" width="79%" cellspacing="1" bgcolor="#C0C0C0" height="1" cellpadding="3">
<tr>
<td width="63%" bgcolor="#FFFFFF" height="45" align="center">
<b><font color="#800000">选择当前游戏卡:</font></b>
<select size="1" name="hw_id">
<%
sql="select * from hw where hw_cz='0'"
rs.open sql,conn,3,3
if rs.eof then
%>
<option value=""></option>
<%else
do while not rs.eof

if hw_id=rs("hw_id") then%>
<option value="<%=rs("hw_id")%>" selected><%=rs("hw_name")%></option>
<%else%>
<option value="<%=rs("hw_id")%>"><%=rs("hw_name")%></option>

<%end if
rs.movenext
loop
end if
rs.close%>
</select></td>
<td width="34%" bgcolor="#FFFFFF" height="45" valign="top">
 </td>
</tr>
<tr>
<td width="63%" bgcolor="#FFFFFF" height="1" valign="top" align="center">
<textarea rows="25" name="SO" cols="37" style="background-color: #FFFFFF; border-style: solid; border-width: 1; padding: 1"></textarea>
</td>
</center>
<center>
</center>
<td width="34%" bgcolor="#FFFFFF" height="1" valign="top">
<font face="黑体" size="4" color="#FF0000">录入须知!</font><br/>1、请在表单中输入点卡的卡号和密码,点卡和密码之间用空格隔开,最多20个空格;<br/>
<p>2、每行只能是一个卡号+空格+密码,否则只取第一个!</p>
<p>3、不能输入任何除字母、数字或“-”之外的任何字符。</p>
<p>4、卡号和密码的长度建议都不超过30位,输入完成后请仔细核对,以免重复或输错。</p>
<p>5、可从文本文档或Excel中复制卡号和密码。</p>
<p>6、密码为空的也必须输入字符,如“无密码”,否则无法录入</p>
<p>7、每次最好不要超过200张点卡,以免因为web表单传递限制导致出错。 
</p>
</td>
</tr>
</table>
<center>
<p><input type="submit" value="提 交" name="subn" style="width: 55; height: 24; background-color: #FFCC99"> 
<input type="reset" value="重 填" name="reset" style="width: 55; height: 24"> </p>
<p>   </p>
</form>
</center>
</div>
</td>
</tr>

</table>

</body>

</html>
<%set rs=nothing%>
...全文
83 4 打赏 收藏 转发到动态 举报
写回复
用AI写文章
4 条回复
切换为时间正序
请发表友善的回复…
发表回复
crazygjg 2006-02-27
  • 打赏
  • 举报
回复
有人知道吗?在线等~~~
crazygjg 2006-02-22
  • 打赏
  • 举报
回复
up!在线ing~~
crazygjg 2006-02-22
  • 打赏
  • 举报
回复
数据量不会很大的,一般就15-20组左右,楼上的大哥帮帮忙可以不?
xxsoft 2006-02-22
  • 打赏
  • 举报
回复
我是通过二维数组的方式保存,但我怕数据量大的时候会撑不了!
垃圾代码,就不在这里出现了,如果需要的话可以联系我!

28,391

社区成员

发帖
与我相关
我的任务
社区描述
ASP即Active Server Pages,是Microsoft公司开发的服务器端脚本环境。
社区管理员
  • ASP
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧