| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 2038 人关注过本帖
标题:我的ASP文件运行时出现了Microsoft VBScript 编译器错误 '800a0400' 缺少语 ...
只看楼主 加入收藏
leeteuk
Rank: 1
等 级:新手上路
帖 子:6
专家分:0
注 册:2010-5-25
结帖率:100%
收藏
已结贴  问题点数:20 回复次数:4 
我的ASP文件运行时出现了Microsoft VBScript 编译器错误 '800a0400' 缺少语句 \admin_student.asp, line 1
Microsoft VBScript 编译器错误 '800a0400'

缺少语句

\admin_student.asp, line 131

<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<%
option explicit
Response.expires=-1
Response.AddHeader "pragma","no-cache"
Response.AddHeader "cache-control","no-store"
%>
<!--#include file="inc/conn.asp"-->
<!--#include file="inc/function.asp"-->

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>考生档案管理</title>
<link href="admin.css" rel="stylesheet" type="text/css">
<style>
body {
    font-size:12px;
}
</style>
</head>

<body>
<table width="90%" align="center" cellspacing="1" cellpadding="0" bgcolor="#FFFFFF"  
class="tborder">
    <tr class="tdtbg">
        <td align="center">
            &nbsp;&nbsp;考&nbsp;&nbsp;生&nbsp;&nbsp;管&nbsp;&nbsp;理
&nbsp;&nbsp;
        </td>
    </tr>
    <tr class="tdbg">
        <td>
            <a href="admin_student.asp">考生管理首页</a> | <a  
href="admin_student.asp?action=add">添加考生</a>
        </td>
    </tr>
</table>
<br>
<%
dim strAction
if checkAdminLogin() = false then      '进行管理员登录验证
   respinse.redirect "admin_login.asp"
end if
if checkPurview(CONST_PURVIEW_STUDENT) = false then
   response.write "<center><font size=4>你没有进行此操作的权限," & "请与系统管理员联系!
</font></center>"
   response.write "</body></html>"
   response.end
end if
strAction = trim(request.querystring("action"))
if strAction = "" then
   strAction = trim(request.querystring("action"))
end if
select case strAction
    case "del"
        call del()    '删除考生
    case "modify"
        call modify()    '修改考生界面
    case "savemodify"
        call saveModify()    '保存修改结果
    case "add"
        call add()    '添加考生界面
    case "saveadd"
        call saveAdd()    '保存添加结果
    case "checkup"
        call checkup()    '审批考生
    case "checkupcancel"
        call checkupcancel()    '取消审批
    case else
        call main()             '主界面
end select
call closeConn()
%>
</body>
</html>
<%
sub main()    '主界面
'定义:Recordset对象,SQL字串,当前页号,最大页号,总学生数
'每页显示学生数,当前在本页第几条记录
dim rsStudent,strSqlStudent,intCurPage,intMaxPage
dim intTotalStudent,intStudentPerPage,intCurRec,I
intStudentPerPage = 24   '设定每页24个考生
if IsNumeric(Trim(request.querystring("page"))) =  true then
     intCurPage = CLng(request.querystring("page"))
else
     intCurPage = 1
end if
%>

<table width="90%" align="center" cellspacing="1" cellpadding="0" bgcolor="#FFFFFF"  
class="tborder">
    <tr class="tdtbg">
        <td width="80" align="center"> 考 生 ID</td>        
        <td align="center"> 登录名称 </td>
        <td width="100" align="center"> 真实姓名 </td>
        <td width="50" align="center"> 性 别 </td>
        <td width="100" align="center"> 状 态 </td>
        <td width="150" align="center"> 操 作 </td>
    </tr>
     <%
     set rsStudent =server.createobject("ADODB.Recordset")
     strSqlStudent = "select * from student"
     rsStudent.open strSqlStudent,G_CONN,1,1
     if rsStudent.bof and rsStudent.eof then
         response.write "<tr class='tdbg'><td colspan='6' align='center'>没有考生</td></tr>"
     end if
     rsStudent.pagesize = intStudentPerPage
     intMaxPage = rsStudent.pagecount
     if intCurPage > rsStudent.pagecount then
           intCurpage = rsStudent.pagecount
     elseif intCurPage < 1 then
           intCurPage = 1
     end if
     if rsStudent.pagecount > 0 then
       rsStudent.absolutepage = intCurPage
     end if
     intCurRec = 1
     while not rsStudent.eof and intCurPage <= intStudentPerPage
       response.write "<tr class='tdbg'>"
       response.write "<td align='center'>" & rsStudent("studentid") & "</td>"
       response.write "<td align='center'>" & rsStudent("username") & "</td>"
       response.write "<td align='center'>" & rsStudent("studentname") & "</td>"
       if rsStudent("sex") = true then
          response.write "<td align='center'>男</td>"
       else
          response.write "<td align='center'>女</td>"
       end if
       if rsStudent("studenttype") = 0 then
          response.write "<td align='center'><font color='#ff5500'> 未 审 批</font></td>"
       else
          response.write "<td align='center'><font color='#229922'> 已 注 册</font></td>"
       end if
       response.write "<td align='center'>"
    response.write "<a href='#' onClick=""if (confirm('删除考生将连同考试记录一起删除," &"你确认
吗?') == true)  window.open('admin_student.asp?action=del&studentid="
 & rsStudent("studentid") & "&page=" & intCurPage & "','_self')"">删除</a> | "
        response.write "<a href='admin_student.asp?action=modify&studentid="
 & rsStudent("studentid") & "&page=" & intCurPage & "'>修改</a> "
       if rsStudent("studenttype") = 0 then
          response.write "| <a href='admin_student.asp?action=checkup&studentid="
    & rsStudent("studentid") & "&page=" & intCurPage & "'>审批</a> "
       end if
       response.write "</td></tr>"
     rsStudent.movenext
        intCurRec = intCurRec + 1
    wend
    rsStudent.close
    set rsStudent = nothing
    %>
</table>
<center>
<%
    '显示页面控制项目
    call showPageCtrl(intMaxPage,intCurPage,"admin_student.asp?page=")
    %>
</center>
<%
           end sub
    %>
<form action="admin_student.asp" method="post">
<input name="action" type="hidden" value="saveadd">
<table width="90%" align="center" cellspacing="1" cellpadding="0" bgcolor="#FFFFFF"  
class="tborder">
    <tr class="tdtbg">
        <td colspan="2" align="center"> 添 加 考 生 </td>
    </tr>
    <tr class="tdbg">
        <td width="180" align="right">登录名称:</td>
        <td>
            <input name="username" type="text" class="text" size="20"  
maxlength="25" value="">
        </td>
    </tr>
    <tr class="tdbg">
        <td width="180" align="right">登录密码:</td>
        <td>
            <input name="studentpwd" type="password" class="text" size="20"  
maxlength="50" value="">
        </td>
    </tr>
    <tr class="tdbg">
        <td width="180" align="right">确认密码:</td>
        <td>
            <input name="confirmpwd" type="password" class="text" size="20"  
maxlength="50" value="">
        </td>
    </tr>
    <tr class="tdbg">
        <td width="180" align="right">真实姓名:</td>
        <td>
            <input name="studentname" type="text" class="text" size="20"  
maxlength="50" value="">
        </td>
    </tr>   
    <tr class="tdbg">
        <td width="180" align="right"> 性  别:</td>
        <td>
            <input name="sex" type="radio" checked value="1">男
&nbsp;&nbsp;&nbsp;&nbsp;
            <input name="sex" type="radio" value="0">女
        </td>
    </tr>
    <tr class="tdbg">
        <td width="180" align="right">出生日期:</td>
        <td>
            <input name="birthday" type="text" class="text" size="20"  
maxlength="25" value="">例:1988-12-11
        </td>
    </tr>   
    <tr class="tdbg">
        <td width="180" align="right">电话号码:</td>
        <td>
            <input name="tel" type="text" class="text" size="20" maxlength="50"  
value="">
        </td>
    </tr>   
    <tr class="tdbg">
        <td width="180" align="right">电子邮件:</td>
        <td>
            <input name="email" type="text" class="text" size="30"  
maxlength="128" value="">
        </td>
    </tr>
    <tr class="tdbg">
        <td align="center" colspan="2">
            <input type="submit" value="&nbsp;添&nbsp;&nbsp;加&nbsp;">
        </td>
    </tr>
</table>
</form>
<%
   sub saveAdd()
   dim rsStudent,strSqlStudent,strUserName,strStudentName,strStudentPwd,strTel
   dim blnSex,strEmail,dtmBirthday,strErr
   strErr = ""
   '取得提交的信息并检查其合理性
   strUserName = trim(request.form("username"))
   strStudentName = trim(request.form("studentname"))
   strStudentPwd = trim(request.form("studentpwd"))
   strTel = trim(request.form("tel"))
   strEmail = trim(request.form("email"))
   if CLng(trim(request.form("sex"))) > 0 then
      blnSex = true
   else
      blnSex = false
   end if
   if strUserName = "" then
      strErr = "<li>登录名为空!</li>"
   end if
   if strStudentPwd = "" then
      strErr = strErr & "<li>密码为空!</li>"
   end if
   if strStudentPwd <> trim(request.form("confirmpwd")) then
      strErr = strErr & "<li>密码与确认密码不对!</li>"
   end if
   if strStudentName = "" then
      strErr =strErr & "<li>真实姓名为空!</li>"
   end if
   if IsDate(trim(request.form("birthday"))) = false then
      strErr = strErr & "<li>日期格式不正确!</li>"
   else
      dtmBirthday = CDate(trim(request.form("birthday")))
   end if
   if G_CONN.execute("select count(*) as reccount from student where studentname='"&  
strStudentName & "'")("reccount") > 0 then
      strErr = strErr & "<li>系统中已存在此登录名!</li>"
   end if
   if strErr <> "" then
      showErrMsg(strErr)
      exit sub
   end if
'保存学生档案到数据库中
   set rsStudent = server.createobject("ADODB.Recordset")
   strSqlStudent = "select * from student where studentid=0"
   rsStudent.Open strSqlStudent,G_CONN,1,3
   rsStudent.addnew
   rsStudent("username") = strUserName
   rsStudent("studentpwd") = strStudentPwd
   rsStudent("studentname") = strStudentName
   rsStudent("birthday") = dtmBirthday
   rsStudent("tel") = strTel
   rsStudent("email") = strEmail
   rsStudent("sex") = blnSex
   rsStudent("studenttype") = 1
   rsStudent.update
   rsStudent.close
   set rsStudent = nothing
   call closeConn()
   response.redirect "admin_student.asp"
end sub
%>
<%
    sub modify()    '修改考生界面
    dim rsStudent,strSqlStudent,intStudentID,strStudentName,strTel,strEmail
    dim blnSex,dtmBirthday,trErr
  strErr =""
    intStudentID = CLng(trim(request.querystrint("studentid")))
'取得要修改考生的信息
    strSqlStudent = "select * from student where studentid=" & intStudentID
    set rsStudent = server.createobject("ADODB.Recordset")
    rsStudent.open strSqlStudent,G_CONN,1,1
    if rsStudent.bof and rsStudent.eof then
       strErr = "<li>此考生不存在!</li>"
    end if
    if strErr <> "" then
      rsStudent.close
      set rsStudent = nothing
      showErrMsg(strErr)
      exit sub
    end if  
    %>
<form action="admin_student.asp" method="post">
<input name="action" type="hidden" value="savemodify">
<input name="studentid" type="hidden" value="<%=intStudentID%>">
<table width="90%" align="center" cellspacing="1" cellpadding="0" bgcolor="#FFFFFF"  
class="tborder">
    <tr class="tdtbg">
        <td colspan="2" align="center"> 修 改 考 生 </td>
    </tr>
    <tr class="tdbg">
        <td width="200" align="right">登录名称:</td>
        <td>
            <font color="#0000FF"><%=rsStudent("username")%></font>
        </td>
    </tr>
    <tr class="tdbg">
        <td width="200" align="right">(留空不修改)登录密码:</td>
        <td>
            <input name="studentpwd" type="password" class="text" size="20"  
maxlength="50" value="">
        </td>
    </tr>
    <tr class="tdbg">
        <td width="200" align="right">(留空不修改)确认密码:</td>
        <td>
            <input name="confirmpwd" type="password" class="text" size="20"  
maxlength="50" value="">
        </td>
    </tr>
    <tr class="tdbg">
        <td width="200" align="right">真实姓名:</td>
        <td>
            <input name="studentname" type="text" class="text" size="20"  
maxlength="50" value="<%=rsStudent("studentname")%>">
        </td>
    </tr>
    <tr class="tdbg">
        <td width="200" align="right"> 性 别:</td>
        <td>
            <input name="sex"
            <%if rsStudent("sex")=1 then Response.Write "checked"%>
             type="radio" value="1">男&nbsp;&nbsp;&nbsp;
            <input name="sex"
            <%if rsStudent("sex")=0 then Response.Write "checked"%>
             type="radio" value="0">女
        </td>
    </tr>   
    <tr class="tdbg">
        <td width="200" align="right">出生日期</td>
        <td>
            <input name="birthday" type="text" class="text" size="20"  
maxlength="25" value="<%= rsStudent("birthday")%>">
        </td>
    </tr>
    <tr class="tdbg">
        <td width="200" align="right">电话号码:</td>
        <td>
            <input name="tel" type="text" class="text" size="20" maxlength="50"  
value="<%=rsStudent("tel")%>">
        </td>
    </tr>
    <tr class="tdbg">
        <td width="200" align="right">电子邮件:</td>
        <td>
            <input name="email" type="text" class="text" size="30"  
maxlength="128" value="<%=rsStudent("email")%>">
        </td>
    </tr>
    <tr class="tdbg">
        <td colspan="2" align="center">
            <input type="submit" value="&nbsp;修&nbsp;&nbsp;改
&nbsp;">&nbsp;&nbsp;
            <input type="reset" value="&nbsp;重&nbsp;&nbsp;写&nbsp;">
        </td>
    </tr>
</table>
</form>
<%
    sub saveModify()     '保存修改结果
    dim rsStudent,strSqlStudent,intStudentID,strUserName,strStudentName
    dim strStudentPwd,blnSex,dtmBirthday,strEmail,strTel,strErr
    strErr = ""
'取得提交的信息并检查其合理性
    intStudentID = CLng(Trim(request.from("studentid")))
    strStudentName = Trim(request.form("studentname"))
    strEmail = Trim(request.form("email"))
    strTel =Trim(request.form("tel"))
    if CLng(trim(request.form("sex"))) > 0 then
       blnSex = true
    else
       blnSex = false
    end if
    if strStudentName = "" then
       strErr = strErr & "<li>出生日期格式错误!</li>"
    else
       dtmBirthday = CDate(trim(request.form("birthday")))
    end if
    if strErr <> "" then
          showErrMsg(strErr)
          exit sub
    end if
'保存考生信息
    set rsStudent = server.createobject("ADODB.Recordset")
    strSqlStudent = "select * from student where studentid=" & intStudentID
    reStudent.open strSqlStudent,G_CONN,1,3
    if rsStudent.bof and rsStudent.eof then
       strErr = "<li>要修改的考生不存在!</li>"
    end if
    if strErr <> "" then
        rsStudent.close
        set rsStudent = nothing
        showErrMsg(strErr)
        exit sub
    end if
    rsStudent("studentname") = strStudentName
    if strStudentPwd <> "" then
       rsStudent("studentpwd") = strStudentPwd
    end if
    rsStudent("sex") = blnSex
    rsStudent("email") = strEmail
    rsStudent("tel") = strTel
    rsStudent("birthday") = dtmBirthday
    reStudent.update
    reStudent.close
    set reStudent = nothing
    call closeConn()
    response.redirect "admin_student.asp"
   end sub
   %>
<%
sub checkup()     '审批考生
     dim intStudentID,strErr
     intStudentID = CLng(Trim(request.querystrint("studentid")))
     if G_CONN.execute("select count(*) as recount from student where studentid =" &  
intStudentID)("reccount") = 0 then
        strErr = "<li>此考生不存在!</li>"
     end if
     if strErr <> "" then
        showErrMsg(strErr)
        exit sub
     end if
     G_CONN.execute("update student set studenttype=1")
     call closeConn()
     response.redirect "admin_student.asp"
end sub
%>
<%
sub del()    '删除考生
    dim intStudentID,strErr
    strErr = ""
    intStudentID = CLng(Trim(request.querystrint("studentid")))
'当考生正在进行考试时是不能删除考生的
    if G_CONN.execute("select count(*) as reccount from prj_student where state=2 "and  
studentid=" & intStudentID)("reccount") > 0 then
      strErr = "<li>此考生正在考试,不能被删除!</li>"
    end if
    if strErr <> "" then
       showErrMsg(strErr)
       exit sub
     end if
'使用事务来删除多个表的相关内容
   G_CONN.begintrans
   G_CONN.execute "delete from prj_process where studentid=" & intStudentID
   G_CONN.execute "delete from prj_student where studentid=" & intStudentID
   G_CONN.execute "delete from student where studentid=" & intStudentID
   G_
   call closeConn()
   response.redirect "admin_student.asp"
 exit sub
 %>         
搜索更多相关主题的帖子: Microsoft student VBScript admin line 
2010-06-01 21:59
hams
Rank: 12Rank: 12Rank: 12
等 级:贵宾
威 望:18
帖 子:912
专家分:3670
注 册:2008-7-30
收藏
得分:14 
自己检查一下这句出来会是什么:


response.write "<a href='#' onClick=""if (confirm('删除考生将连同考试记录一起删除," &"你确认
吗?') == true)  window.open('admin_student.asp?action=del&studentid="
& rsStudent("studentid") & "&page=" & intCurPage & "','_self')"">删除</a> | "
        response.write "<a href='admin_student.asp?action=modify&studentid="
& rsStudent("studentid") & "&page=" & intCurPage & "'>修改</a> "
       if rsStudent("studenttype") = 0 then
          response.write "| <a href='admin_student.asp?action=checkup&studentid="
    & rsStudent("studentid") & "&page=" & intCurPage & "'>审批</a> "

俺不高手,俺也是来学习的。
俺的意见不一定就对,当你不认同时请点忽视按钮。
当走到十字路口不知该如何走时,可在论坛问下路,但你若希望别人能一路把你送到目的地,显然是不现实的,因为别人也有自己要走的路。
2010-06-02 09:06
leeteuk
Rank: 1
等 级:新手上路
帖 子:6
专家分:0
注 册:2010-5-25
收藏
得分:0 
就是点击删除,跳出“删除考生将连同考试记录一起删除," &"你确认
吗?”点击“是”这个考生就会被删除掉!
2010-06-02 12:19
hams
Rank: 12Rank: 12Rank: 12
等 级:贵宾
威 望:18
帖 子:912
专家分:3670
注 册:2008-7-30
收藏
得分:0 
先把这段删了看会不会正常

俺不高手,俺也是来学习的。
俺的意见不一定就对,当你不认同时请点忽视按钮。
当走到十字路口不知该如何走时,可在论坛问下路,但你若希望别人能一路把你送到目的地,显然是不现实的,因为别人也有自己要走的路。
2010-06-02 15:43
leeteuk
Rank: 1
等 级:新手上路
帖 子:6
专家分:0
注 册:2010-5-25
收藏
得分:0 
不行,好像还不止这一段错误,把那段删了之后还是有错误,但是怎么看都觉得没错啊!!要不加一下我QQ好吗??847588707
2010-06-02 17:30
快速回复:我的ASP文件运行时出现了Microsoft VBScript 编译器错误 '800a0400' 缺 ...
数据加载中...
 
   



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

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