| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 555 人关注过本帖
标题:[求助]奇怪的问题,大家来帮忙看一下,谢谢!!
只看楼主 加入收藏
zmyzzz
Rank: 1
等 级:新手上路
帖 子:145
专家分:0
注 册:2005-9-21
收藏
 问题点数:0 回复次数:2 
[求助]奇怪的问题,大家来帮忙看一下,谢谢!!

是关于往表中插入纪录的问题,用户输入信息的页面为sgfy.asp,插入纪录的页面为sgtj.asp
sgfy.asp

<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<!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">
<!--
body {
margin-top: 0px;
background-image: url(../../img/beijing.gif);
}
.style1 {font-family: "宋体"}
.style2 {font-size: 10pt}
.style4 {font-family: "宋体"; font-size: 10pt; }
.style6 {font-family: "宋体"; font-size: 10pt; color: #FF0000; }
-->
</style>
<script language="vbscript">
sub checkform()
if trim(form1.zaphone.value)="" then
msgbox("请输入障碍手机号!")
form1.zaphone.focus()
window.event.returnValue=false
return
end if
if IsNumeric(form1.zaphone.value)=false then
msgbox("障碍手机号码必须输入数字!")
form1.zaphone.focus()
window.event.returnValue=false
return
end if
if trim(form1.zatime.value)="" then
msgbox("请输入所要查询费用的年月!!")
form1.zatime.focus()
window.event.returnValue=false
return
end if
if trim(form1.textzhuti.value)="" then
msgbox("障碍主题不能为空!")
form1.textzhuti.focus()
window.event.returnValue=false
return
end if
if trim(form1.textneirong.value)="" then
msgbox("障碍内容不能为空!")
form1.textneirong.focus()
window.event.returnValue=false
return
end if
end sub
</script>
</head>

<body>
<div align="center">
<table width="780" border="0" cellspacing="0" cellpadding="0">
<tr>
<td><img src="../../img/logo2.gif" width="780" height="50"></td>
</tr>
</table>
<table width="780" border="0" cellspacing="0" cellpadding="0">
<tr>
<td><form name="form1" method="post" onsubmit="checkform()" action="/shengao/sgtj/asp/sgtj.asp">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td><div align="right"></div> <div align="left">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="1%" bgcolor="#5A9ADE"><div align="right" class="style1 style2"></div></td>
<td width="21%" bgcolor="#5A9ADE"><div align="left" class="style4">
<div align="right"><span class="style1 style2">申告人:</span></div>
</div></td>
<td width="23%" bgcolor="#5A9ADE"><div align="right" class="style4">
<div align="left"><%=Session("username")%></div>
</div></td>
<td width="17%" bgcolor="#5A9ADE"><div align="left" class="style4">
<div align="right"></div>
</div></td>
<td width="10%" bgcolor="#5A9ADE"><div align="right"><span class="style2">时间:</span></div></td>
<td width="27%" bgcolor="#5A9ADE"><div align="left"><span class="style2"><span class="style4"><%=now()%></span>
</span></div></td>
<td width="1%" bgcolor="#5A9ADE">&nbsp;</td>
</tr>
</table>
</div></td>
</tr>
<tr>
<td><table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr class="style4">
<td width="1%" bgcolor="#5A9ADE"><div align="right"></div></td>
<td width="21%" bgcolor="#63A6E7"><div align="right">电话:</div></td>
<td width="20%" bgcolor="#63A6E7"><div align="left"><%=Session("uphone")%></div></td>
<td width="9%" bgcolor="#63A6E7">&nbsp;</td>
<td width="10%" bgcolor="#63A6E7"><span class="style2">
</span></td>
<td width="12%" bgcolor="#63A6E7"><span class="style2">
<input name="sgzhuangtai" type="hidden" id="sgzhuangtai3" value="未受理">
</span></td>
<td width="26%" bgcolor="#63A6E7"><span class="style2">
<input name="sgtime" type="hidden" id="sgtime2" value="<%=now()%>">
<input name="fenlei1" type="hidden" id="fenlei1" value="11111">
<input name="fenlei2" type="hidden" id="fenlei2" value="22222">
</span></td>
<td width="1%" bgcolor="#5A9ADE">&nbsp;</td>
</tr>
</table>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="1%" bgcolor="#5A9ADE">&nbsp;</td>
<td width="21%" bgcolor="#73aee7" class="style4"><div align="right">号码:</div></td>
<td width="20%" bgcolor="#73aee7" class="style4"><div align="left">
<input name="zaphone" type="text" id="zaphone" size="20" maxlength="11">
</div></td>
<td width="20%" bgcolor="#73aee7" class="style4"><div align="right">查询年月:</div></td>
<td width="37%" bgcolor="#73aee7" class="style4"><div align="left">
<input name="zatime" type="text" id="zatime" size="27" maxlength="20">
</div></td>
<td width="1%" bgcolor="#5A9ADE">&nbsp;</td>
</tr>
</table>
</td>
</tr>
<tr>
<td bgcolor="#B5D7F7"><table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="1%" bgcolor="#5A9ADE"><div align="right" class="style4"></div></td>
<td width="21%"><div align="right"><span class="style4">主题:</span> </div></td>
<td width="77%"><div align="left">
<input name="textzhuti" type="text" id="textzhuti2" size="54" maxlength="20">
<span class="style6">请不要超过20个汉字</span></div></td>
<td width="1%" bgcolor="#5A9ADE">&nbsp;</td>
</tr>
</table></td>
</tr>
<tr>
<td><table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="1%" bgcolor="#5A9ADE"><div align="right" class="style4"></div></td>
<td width="21%" align="right" valign="top" bgcolor="#DEEFFF"><div align="right"><span class="style4">内容:</span>
</div></td>
<td width="77%" bgcolor="#DEEFFF"><div align="left">
<textarea name="textneirong" cols="70" rows="10" id="textarea"></textarea>
</div></td>
<td width="1%" bgcolor="#5A9ADE">&nbsp;</td>
</tr>
</table></td>
</tr>
<tr>
<td><table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr bgcolor="#5A9ADE">
<td width="36%"><div align="right">
<input type="submit" name="Submit" value="提交">
</div></td>
<td width="28%">&nbsp;</td>
<td width="36%"><div align="left">
<input type="reset" name="Submit2" value="重写">
</div></td>
</tr>
</table></td>
</tr>
</table>
</form></td>
</tr>
</table>
</div>
</body>
</html>


sgtj.asp 插入纪录页面...在测试中这个是可以插入空的纪录的


<%@LANGUAGE="VBSCRIPT
" CODEPAGE="936"%>
<%
option explicit
dim conn,db,rs,sql,sgren,sgtime,sgphone,sgzhuti,sgzhuangtai,zaphone,zatime,fenleid,fenleix
dim sgneirong
db="/mdb/login.mdb"
sgren=Session("username")
sgtime=request.form("sgtime")
sgphone=Session("uphone")
sgzhuti=request.form("textzhuti")
sgneirong=request.form("textneirong")
sgneirong=replace(sgneirong,chr(13),"<br>")'替换回车
sgneirong=replace(sgneirong," ","&nbsp;&nbsp;")'替换空格
sgzhuangtai=request.form("sgzhuangtai")
zaphone=request.form("zaphone")
zatime=request.form("zatime")
fenleid=request.form("fenlei1")
fenleix=request.form("fenlei2")
Set conn = Server.CreateObject("ADODB.Connection")
conn.open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & Server.MapPath(db)
sql="select * from shengao1 where zhuti='"&sgzhuti&"'"
Set rs = Server.CreateObject("ADODB.RecordSet")
rs.open sql,conn,1,2
if not rs.eof then
%>
<style type="text/css">
<!--
.style1 {
font-family: "宋体";
font-size: 10pt;
}
.style2 {color: #FF0000}
body {
background-image: url(../../img/beijing.gif);
}
-->
</style>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<span class="style1">
您所发布的障碍主题已经有人发布过了,请修改主题!
<%
else
rs.addnew
rs("name")=sgren
rs("phone")=sgphone
rs("zhuti")=sgzhuti
rs("miaoshu")=sgneirong
rs("date_time")=sgtime
rs("xulie")=sgzhuangtai
rs("gonghao")=Session("user")
rs("zaphone")=zaphone
rs("zatime")=zatime
rs("fenleid")=fenleid
rs("fenleix")=fenleix
rs.update
%>
</span>
<span class="style1">障碍:<span class="style2"><%=sgzhuti%></span>添加成功,请<a href="../../../loginok.asp">返回主页</a>!
<%
end if
rs.close
conn.close
set conn=nothing
%>
</span>

可是我怎么从sgfy.asp点击提交后提示我:

无法显示网页
您要访问的网页有问题,无法显示。

请尝试以下操作:


HTTP 500 - 内部服务器错误
Internet Explorer


搜索更多相关主题的帖子: blank content PUBLIC target color 
2005-11-03 17:04
islet
Rank: 12Rank: 12Rank: 12
等 级:贵宾
威 望:89
帖 子:6548
专家分:0
注 册:2005-1-28
收藏
得分:0 
你改一下IE的属性--高级

按这个改http://www.gaizhou-window.com/images/iesx.gif

改完再看错误信息
2005-11-03 17:21
zmyzzz
Rank: 1
等 级:新手上路
帖 子:145
专家分:0
注 册:2005-9-21
收藏
得分:0 

Provider 错误 '80020005'

类型不匹配。

/shengao/sgtj/asp/sgtj.asp,行 52


我明白了...已经正常,谢谢!!!

[此贴子已经被作者于2005-11-3 18:38:38编辑过]


吾尝终日而思之,不如须臾之所学也
2005-11-03 18:36
快速回复:[求助]奇怪的问题,大家来帮忙看一下,谢谢!!
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.030056 second(s), 7 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved