为什么插入不了数据库呢??没有错误提示......
而且能显示 数据已成功录入,谢谢!!
但实际上没有插进去.............
代码如下:
<!--#include file="Conn.asp"-->
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>信息录入</title>
<style type="text/css">
<!--
.style7 {font-family: "黑体"; font-size: 10pt; }
.style8 {font-size: 10pt}
.style9 {font-family: "黑体"}
.style15 {font-size: 10pt; font-family: "宋体"; }
-->
</style>
<script language="vbscript">
sub checkform()
if trim(form1.select.value)="" then
msgbox("请选择项目!")
form1.select.focus()
window.event.returnValue=false
return
end if
end sub
</script>
</head>
<body>
<%
sub assignHowMuch()
%>
<form action="" method="post" name="form1" class="style7" onsubmit="checkform()">
请输入您所要输入的项目:
<%
set rs=Server.CreateObject("ADODB.RecordSet")
sql="select * from xiangmu"
rs.open sql, conn, 1, 1
%>
<select name="select">
<option selected>请选择</option>
<%while not rs.eof%>
<option value="<%=rs("xm_name")%>"><%=rs("xm_name")%></option>
<% rs.movenext
wend%>
</select>
请输入录入的条数:
<input name="textid" type="text" id="textid" size="4" maxlength="4">
<input type="submit" name="Submit" value="下一步>>">
</form>
<%
end sub
sub Inputdata()
call assignHowMuch()
dim recCnt,i
%>
<form name="form2" method="post" action="">
<table width="80%" border="0" cellpadding="0" cellspacing="0" bordercolor="#000000" style="border-collapse: collapse">
<%
recCnt=cint(request.form("textid"))
xiangmu=request.form("select")
for i=1 to recCnt
%>
<tr>
<td width="3%" nowrap><span class="style7"><%=i%></span></td>
<td width="22%" nowrap><div align="left" class="style8"><span class="style9">电话:
<input name="textphone" type="text" id="textphone" size="12" maxlength="11">
</span></div></td>
<td width="22%" nowrap><div align="left" class="style15">发展人:
<input name="textfield" type="text" size="10" maxlength="10">
</div></td>
<td width="10%" nowrap class="style9"><div align="right" class="style15 style8">发展时间:</div></td>
<td width="14%" nowrap class="style9"><div align="left" class="style15"><%=now()%>
<input name="textdate" type="hidden" id="textdate" value="<%=now()%>">
</div></td>
<td width="11%" nowrap class="style9"><div align="right" class="style15">发展项目:</div></td>
<td width="18%" nowrap class="style9"><span class="style15"><%=xiangmu%>
<input name="textxiangmu" type="hidden" id="textxiangmu" value="<%=xiangmu%>">
<input name="reccint" type="hidden" id="reccint" value="<%=recCint%>">
</span></td>
</tr>
<%next%>
</table>
<input name="Submit" type="submit" id="Submit" value="提交">
</form>
<%end sub%>
<%sub writedata()
dim reccnt,i
dim phone,fname,datetime,xianmgu
set rs=Server.CreateObject("ADODB.RecordSet")
sql="select * from fazhan"
rs.open sql,conn,3,3
reccnt=cint(request.form("reccnt"))
for i=1 to reccint
phone=trim(request.form("textphone")(i))
fname=trim(request.form("textfield")(i))
datetime=request.form("textdate")(i)
xiangmu=trim(request("textxiangmu")(i))
rs.addnew
rs("phone")=phone
rs("fazhanren")=fname
rs("date_time")=datetime
rs("xiangmu")=xiangmu
rs.update
next
rs.close
conn.close
set conn=nothing
response.write "数据已成功录入,谢谢!!"
end sub
%>
<%if request.form("Submit")="下一步>>" then
call InputData()
elseif request.form("Submit")="提交" then
call writedata()
else
call assignHowMuch()
end if
%>
<p> </p>
</body>
</html>
谁能帮我看看啊...谢谢........