请高手帮我解决一下(快要折磨死了)数据提交的问题(70分)

  • 主题发起人 主题发起人 shhw
  • 开始时间 开始时间
S

shhw

Unregistered / Unconfirmed
GUEST, unregistred user!
当提交注册信息时会变得非常的慢。
只有再点击一次提交按钮时才可以提交成功。
请问是上面原因
单元代码如下:
<%@LANGUAGE=&quot;VBSCRIPT&quot;
CODEPAGE=&quot;936&quot;%>
<!--#include file=&quot;Conn.asp&quot;-->
<%
action=Request(&quot;action&quot;)
userName=trim(Request.Form(&quot;userName&quot;))
UserPass=trim(Request.Form(&quot;UserPass&quot;))
RUserPass=trim(Request.Form(&quot;RUserPass&quot;))
TrueName=trim(Request.Form(&quot;TrueName&quot;))
SEx=Request.Form(&quot;SEx&quot;)
Age=Request.Form(&quot;Age&quot;)
Native=Request.Form(&quot;Native&quot;)
Marriage=Request.Form(&quot;Marriage&quot;)
character=Request.Form(&quot;character&quot;)
WorkType=Request.Form(&quot;WorkType&quot;)
Duty=Request.Form(&quot;Duty&quot;)
Indvove=Request.Form(&quot;Indvove&quot;)
tAddress=Request.Form(&quot;tAddress&quot;)
if action =&quot;yes&quot;
then
set rs=Server.CreateObject(&quot;adodb.recordset&quot;)
rs.open &quot;select * from EmpINfo &quot;,conn,1,3
rs.addnew
rs(&quot;userName&quot;)=userName
rs(&quot;PassWord&quot;)=UserPass
rs(&quot;EmpName&quot;)=TrueName
rs(&quot;SEx&quot;)=SEx
rs(&quot;Age&quot;)=Age
rs(&quot;Native&quot;)=Native
rs(&quot;Espousal&quot;)=Marriage
rs(&quot;character&quot;)=character
rs(&quot;WorkType&quot;)=WorkType
rs(&quot;Duty&quot;)=Duty
rs(&quot;Indvlove&quot;)=Indvove
rs(&quot;Address&quot;)=tAddress
rs.update
rs.close
end if
%>
<!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.01 Transitional//EN&quot;&quot;http://www.w3.org/TR/html4/loose.dtd&quot;>
<html>
<head>
<meta http-equiv=&quot;Content-Type&quot;
content=&quot;text/html;
charset=gb2312&quot;>
<title>无标题文档</title>
<style type=&quot;text/css&quot;>
<!--
.style1 {font-size: larger;font-size: 12px}
.style4 {color: #999999;
font-size: x-large;
}
.style5 {font-family: &quot;宋体&quot;}
.style6 {font-size: larger;font-size: 12px}
-->
</style>
</head>
<script language=&quot;javascript&quot;>
<!--
function userlogin()
{
if (document.form1.userName.value==&quot;&quot;){
alert(&quot;名称不能为空!&quot;)
do
cument.form1.userName.focus();
return false
}
if (document.form1.UserPass.value==&quot;&quot;){
alert(&quot;密码不能为空!&quot;);
do
cument.form1.UserPass.focus();
return false
}
if (document.form1.UserPass.value!=document.form1.RUserPass.value){
alert(&quot;两次输入的密码不一致!&quot;);
do
cument.form1.RUserPass.focus();
return false
}
return true
}
function reset_form()
{
do
cument.form1.userName.value=&quot;&quot;;
do
cument.form1.UserPass.value=&quot;&quot;;
do
cument.form1.RUserPass.value=&quot;&quot;;
do
cument.form1.userName.focus;
}
//-->
</script>
<body>
<h1 align=&quot;center&quot;><span class=&quot;style1&quot;><span class=&quot;style4&quot;>
<label><strong>用户注册</strong></label>
</span> </span> </h1>
<form name=&quot;form1&quot;
method=&quot;post&quot;
action=&quot;?action=yes&quot;>
<table width=&quot;677&quot;
height=&quot;372&quot;
border=&quot;1&quot;
align=&quot;center&quot;
bordercolor=&quot;#9933FF&quot;>
<tr>
<td width=&quot;704&quot;
height=&quot;353&quot;
align=&quot;left&quot;
valign=&quot;top&quot;
class=&quot;style6&quot;> <table width=&quot;100%&quot;
height=&quot;225&quot;
border=&quot;0&quot;>
<tr>
<td width=&quot;82&quot;
height=&quot;29&quot;
align=&quot;right&quot;
valign=&quot;middle&quot;> <div align=&quot;right&quot;>*名称:</div></td>
<td width=&quot;140&quot;
align=&quot;left&quot;><span class=&quot;style5&quot;>
<input name=&quot;userName&quot;
type=&quot;text&quot;
id=&quot;UserPass4&quot;
size=&quot;20&quot;
maxlength=&quot;15&quot;>
</span></td>
<td width=&quot;84&quot;
height=&quot;29&quot;
align=&quot;center&quot;><div align=&quot;right&quot;>*密码: </div></td>
<td width=&quot;105&quot;
align=&quot;left&quot;><span class=&quot;style5&quot;>
<input name=&quot;UserPass&quot;
type=&quot;password&quot;
id=&quot;UserPass&quot;
size=&quot;15&quot;
maxlength=&quot;15&quot;>
</span></td>
<td width=&quot;84&quot;
align=&quot;center&quot;><div align=&quot;right&quot;>*确认密码: </div></td>
<td width=&quot;146&quot;
align=&quot;left&quot;><input name=&quot;RUserPass&quot;
type=&quot;password&quot;
id=&quot;UserPass22&quot;
size=&quot;16&quot;
maxlength=&quot;15&quot;></td>
</tr>
<tr>
<td height=&quot;23&quot;
align=&quot;right&quot;
valign=&quot;middle&quot;><div align=&quot;right&quot;>*姓名: </div></td>
<td align=&quot;left&quot;><input name=&quot;TrueName&quot;
type=&quot;text&quot;
id=&quot;TrueName&quot;
size=&quot;20&quot;
maxlength=&quot;20&quot;></td>
<td align=&quot;center&quot;><div align=&quot;right&quot;>性别: </div></td>
<td align=&quot;left&quot;><select name=&quot;SEx&quot;
size=&quot;1&quot;
id=&quot;select2&quot;>
<option selected>男</option>
<option>女</option>
</select></td>
<td align=&quot;center&quot;><div align=&quot;right&quot;>年龄: </div></td>
<td align=&quot;left&quot;><input name=&quot;Age&quot;
type=&quot;text&quot;
id=&quot;Age&quot;
value=&quot;1&quot;
size=&quot;8&quot;
maxlength=&quot;3&quot;></td>
</tr>
<tr>
<td height=&quot;23&quot;
align=&quot;right&quot;
valign=&quot;middle&quot;><div align=&quot;right&quot;>籍贯: </div></td>
<td align=&quot;left&quot;><input name=&quot;Native&quot;
type=&quot;text&quot;
id=&quot;Native&quot;
size=&quot;20&quot;
maxlength=&quot;10&quot;></td>
<td align=&quot;center&quot;><div align=&quot;right&quot;>婚否: </div></td>
<td align=&quot;left&quot;><select name=&quot;Marriage&quot;
size=&quot;1&quot;
id=&quot;Marriage&quot;>
<option selected>已婚</option>
<option>未婚</option>
<option>离异</option>
<option>其它</option>
</select></td>
<td align=&quot;center&quot;><div align=&quot;right&quot;>性格:</div></td>
<td align=&quot;left&quot;><select name=&quot;character&quot;
size=&quot;1&quot;
id=&quot;select5&quot;>
<option selected>外向</option>
<option>内向</option>
<option>偏外</option>
<option>偏内</option>
<option>中性</option>
</select></td>
</tr>
<tr>
<td height=&quot;18&quot;
align=&quot;right&quot;
valign=&quot;middle&quot;><div align=&quot;right&quot;>行业: </div></td>
<td align=&quot;left&quot;><input name=&quot;WorkType&quot;
type=&quot;text&quot;
id=&quot;WorkType&quot;
size=&quot;20&quot;
maxlength=&quot;20&quot;></td>
<td align=&quot;center&quot;><div align=&quot;right&quot;>职称:</div></td>
<td colspan=&quot;3&quot;
align=&quot;left&quot;><input name=&quot;Duty&quot;
type=&quot;text&quot;
id=&quot;Duty3&quot;
size=&quot;44&quot;
maxlength=&quot;20&quot;></td>
</tr>
<tr>
<td height=&quot;71&quot;
align=&quot;right&quot;
valign=&quot;middle&quot;><div align=&quot;right&quot;>爱好:</div></td>
<td colspan=&quot;5&quot;
valign=&quot;top&quot;><label>
<textarea name=&quot;Indvove&quot;
cols=&quot;75&quot;
rows=&quot;4&quot;
id=&quot;Indvove&quot;></textarea>
</label></td>
</tr>
<tr>
<td height=&quot;44&quot;
align=&quot;right&quot;
valign=&quot;middle&quot;><div align=&quot;right&quot;>住址:</div></td>
<td colspan=&quot;5&quot;
valign=&quot;top&quot;><textarea name=&quot;tAddress&quot;
cols=&quot;75&quot;
rows=&quot;2&quot;
id=&quot;tAddress&quot;></textarea></td>
</tr>
</table>
<table width=&quot;100%&quot;
border=&quot;0&quot;>
<tr>
<td width=&quot;22%&quot;
height=&quot;63&quot;> </td>
<td width=&quot;28%&quot;
align=&quot;right&quot;><input name=&quot;submit&quot;
type=&quot;submit&quot;
id=&quot;SubPut&quot;
onClick=&quot;return userlogin()&quot;
value=&quot;提交&quot;></td>
<td width=&quot;29%&quot;
align=&quot;left&quot;><input name=&quot;submit&quot;
type=&quot;submit&quot;
id=&quot;SubRfill&quot;
value=&quot;重填&quot;></td>
<td width=&quot;21%&quot;> </td>
</tr>
</table> </td>
</tr>
</table>
</form>
</body></html>
 
从代码看没什么问题,找找别的原因
 
这位大哥 能否给出一个简单的例子吗?
只要两个页面的连接
其中:一个登录界面 一个注册界面
f_y_h@163.com
一定给分
 
<%
'因为虚拟服务器的限制所以采用access数据库,
'并且没有采用com+的方式
dim oConn,oRs,curDir,Index
'curDir = Server.MapPath(&quot;db.mdb&quot;)
curDir=&quot;D:/xxx.mdb&quot;
set oConn = Server.CreateObject(&quot;ADODB.Connection&quot;)
oConn.Open &quot;Provider=Microsoft.Jet.OLEDB.4.0;Jet OLEDB:Database Password=1234;Data Source=&quot;
& curDir
set oRs = Server.CreateObject(&quot;ADODB.Recordset&quot;)
oRs.ActiveConnection = oConn
%>
你连ADODB.Connection对象都没有,到网络上找很多。。。
 
不好意思,最好采用sql语句直接写进去...
 
huasoft_hth,说的有道理,代码没问题.可能是别的问题(其他文件配置的问题等).

你不给出别的代码,我们是没有办法看出是什么问题的.
 
rs.update
rs.close
加上一行: set rs=nothing
 
用response.write 变量
response.end 来判断在哪行出错.
 
后退
顶部