| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 562 人关注过本帖
标题:[原创]进来看看
只看楼主 加入收藏
darkhorse
Rank: 1
等 级:新手上路
帖 子:4
专家分:0
注 册:2005-1-10
收藏
 问题点数:0 回复次数:4 
[原创]进来看看
麻烦大家帮帮忙修改一下,总是Open句子出错,我上传了一个压缩包,里边是一个网上考试系统,看看大家谁能帮着修改一下,多谢了!!!
<%@ Language=VBScript %>
<%
if Request.ServerVariables("http_method")="POST" then
 if Request.Form("submit")="进入1" then
  '学生进入网络考场的处理
  set conn=server.CreateObject("adodb.connection")
  conn.ConnectionString="dsn=testsys"
  '连接并打开数据库
  conn.open studentinfo
  strsql="select * from studentinfo where stid='" & Request.Form("stid") & "' and stname='" & Request.Form("stname") & "'"
  set mrs=conn.Execute(strsql)
  if not mrs.bof and  not mrs.eof then
  '如果数据库中存在该学生的记录进入网络考场
  '并用session属性存储学生的姓名与学号
   session("stid")=Request.Form("stid")
   session("stname")=Request.Form("stname")
   Response.Redirect "stselectsub.asp"
   set mrs=nothing
  else
  '如果数据库中不存在该学生的信息,显示的页面仍为logon.asp,并提示信息
   Response.Write "学生姓名与学号输入错误!!"
  end if
  conn.Close
  set conn=nothing
 else
  '教师进入网络考场的处理
  set conn=server.CreateObject("adodb.connection")
  conn.ConnectionString="dsn=testsys"
  conn.open teacherinfo
  strsql="select * from teacherinfo where teachid='" & Request.Form("teachid") & "' and teachname='" & Request.Form("teachname") & "'"
  set mrs=conn.Execute(strsql)
  if not mrs.bof and not mrs.eof then
  '如果数据库中存在该教师的记录进入网络考场
  '用session属性保持教师姓名与编号
   session("teachid")=Request.Form("teachid")
   session("teachname")=Request.Form("teachname")
   Response.Redirect "tcreatefrm2.asp"
  else
  '如果数据库中不存在该教师的信息,显示的页面仍为logon.asp,并提示信息
   Response.Write "教师的姓名和编号输入错误!!"
  end if
  set mrs=nothing
  '关闭数据库连接
  conn.close
  '清空对象变量
  set conn=nothing
 end if
end if
%>
<HTML>
<HEAD>
<META NAME="GENERATOR" Content="Microsoft Visual Studio 6.0">
</HEAD>
<BODY>
<FORM action="logon.asp" method=post id=form1 name=form1>
<P align=center>
<FONT color=crimson face=隶书 size=6>网 络 考 场</FONT></P>
<P align=center>
<TABLE border=0 cellPadding=1 cellSpacing=1 width=75%>
    <TR bgcolor=wheat>
        <TD>
            <DIV align=center><STRONG><FONT
            color=mediumslateblue face=幼圆 size=4>学 生</FONT></STRONG></DIV>
        <TD>
            <DIV align=center><FONT color=mediumslateblue
            face=幼圆 size=4><STRONG>教
            师</STRONG></FONT></DIV>
    <TR  bgcolor=ivory>
        <TD>
  <P align=center>姓名<INPUT id=text1 name=stname></P></TD>
        <TD>
  <P align=center>姓名<INPUT id=text2 name=teachname value=zhong></P></TD></TR>
    <TR  bgcolor=ivory>
        <TD>
        <P align=center>学号<INPUT id=password1 name=stid type=password></P></TD>
        <TD>
        <P align=center>编号<INPUT id=password1 name=teachid type=password ></P></TD></TR>
    <TR  bgcolor=ghostwhite>
        <TD >
            <DIV align=center><INPUT id=submit1 name=submit type=submit value=进入1 ></DIV></TD>
        <TD>
            <DIV align=center><INPUT id=submit2 name=submit type=submit value=进入2></DIV></TD></TR></TABLE></P>
</FORM>
</BODY>
</HTML>
搜索更多相关主题的帖子: 考试系统 数据库 压缩包 where 网络 
2005-01-10 22:05
belin2000
Rank: 3Rank: 3
等 级:论坛游侠
威 望:5
帖 子:975
专家分:194
注 册:2004-6-2
收藏
得分:0 
那里错啊??

59ita点com(我就爱TA)
2005-01-10 22:22
darkhorse
Rank: 1
等 级:新手上路
帖 子:4
专家分:0
注 册:2005-1-10
收藏
得分:0 
是在conn.open studentinfo错了!!!
2005-01-10 23:03
regedit
Rank: 5Rank: 5
等 级:贵宾
威 望:19
帖 子:950
专家分:0
注 册:2004-6-8
收藏
得分:0 
conn.open studentinfo和conn.open teacherinfo改为:conn.open ()

最新作品:百货品牌商品资讯第一门户([url]http://www./[/url]),欢迎交流
2005-01-11 09:49
龙行天下
Rank: 1
等 级:新手上路
帖 子:35
专家分:0
注 册:2005-1-5
收藏
得分:0 
你好啊
能和你交个朋友吗?
我现在在学习WEB呢,希望在以后的日子里能和你经常的交流啊,
还有就是记着给我回帖子啊,我是龙行天下!!
还有就是能告诉我你是什么地方的的吗。
好了就和尼 说这么多吧,我还要干活呢,以后在交流啊,祝尼 工作顺利,早点发财啊!![em45][em45][em45][em45][em45][em45][em45][em45]
2005-01-12 08:42
快速回复:[原创]进来看看
数据加载中...
 
   



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

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