asp大问题???????

syl66666 2005-04-05 10:34:13
<form name="form1" method="post" action="bmquery.asp">
<table width="98%" border="0" height="52">
<tr>
<td width="20%" height="58">请输入您的ID号:</td>
<td height="58" colspan="2">
<div align="left">
<input type="text" name="id1" size="15">
</div>
</td>
</tr>
<tr>
<td colspan="3" height="42">
<div align="right">--------------------------------------------------------------------------------------------
</div>
<div align="center"> </div>
</td>
</tr>
<tr>
<td width="20%">
<div align="right">
<input type="button" value="查 询" onclick="querybm()" name="button1">
</div>
</td>
<td width="38%">
<div align="center">
<input type="reset" name="reset" value="重 查">
</div>
</td>
<td width="42%"> </td>
</tr>
</table>
</form>
<p> </p>
</TD>
</TR>
<TR vAlign=top>
<TD height=66><font size="4" color="#990066">
<%

function querybm()
dim conn
dim msg
document.form1.submit()
set conn=server.createobject("adodb.connction")
conn.open "dsn=comprg_mzbm;uid=9linux8mzbm;pwd=;"
set rs=server.createobject("adodb.recordset")
num=trim(request("id1"))

comtxt="select xm,sex,chushengriqi,parent_name,phone_h,mobile,city,dz from stu_info where id="&num&""

rs.open comtxt,conn
if rs.bof or rs.eof then
msg="你的ID号为空或有误,请检查!"
end if
if msg="" then
response.write "你的个人信息如下:"
response.write "<br>"
do while not rs.eof
for i=0 to rs.count-1
response.write rs(i).value
response.write "<br>"
next
rs.movenext
loop
response.write "欢迎您!!!"
else
response.write msg
end if
rs.close
conn.close
set rs=nothing
set conn=nothing
end function

%>
</font></TD>
</TR>
始终有问题,请各位给予解答.
...全文
191 11 打赏 收藏 转发到动态 举报
写回复
用AI写文章
11 条回复
切换为时间正序
请发表友善的回复…
发表回复
syl66666 2005-04-06
  • 打赏
  • 举报
回复
我想点击提交ID后,针对ID显示出数据库中对应的ID的信息,我用的是SQL,但提交后好像有错,而提示一晃而过,看不到
  • 打赏
  • 举报
回复
你是不是从.net转过来的??
underone 2005-04-06
  • 打赏
  • 举报
回复
<input type="button" value="查 询" onclick="querybm()" name="button1">
应该用submit
xxzcn 2005-04-06
  • 打赏
  • 举报
回复
bmquery.asp在哪里?
擒兽 2005-04-06
  • 打赏
  • 举报
回复
我以为像PHP一样来了个专门攻击ASP的蠕虫...

楼主你把代码缩进缩进。
lstup 2005-04-05
  • 打赏
  • 举报
回复
……大问题?
  • 打赏
  • 举报
回复
什么问题呢
submit类型的按钮会首先执行提交动作。。
scoutlin 2005-04-05
  • 打赏
  • 举报
回复
<input type="button" value="查 询" onclick="querybm()" name="button1">
==>
<input type="submit" value="查 询" name="button1">
syl66666 2005-04-05
  • 打赏
  • 举报
回复
不行,反而出现 缺少 'If' 的错误
scoutlin 2005-04-05
  • 打赏
  • 举报
回复
function querybm()
dim conn
dim msg
document.form1.submit()


if request("id")<>"" then

end function

end if
syl66666 2005-04-05
  • 打赏
  • 举报
回复
为什么没有输出结果.???????

28,406

社区成员

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

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