快速业务通道

用ASP开发试题库与在线考试系统

作者 佚名技术 来源 NET编程 浏览 发布时间 2012-05-21
mp; Mid(adj_str, i, 1)
   End Select
  Next
 End If
 adjust_sql = final_str
End Function
Sub Output_shiti()
 Dim kmxxmc,xzsj,stbh,zhang,jie,tmlx,nycd,jxyq,lrz,stnr,cond_count, Picstr
 Dim SQLstr,mf,zhangfw,jiefw,stbhfw,nycdfw,lr_datefw,lr_date
 ''记录指定条件的栏位总数
 cond_count = 10; mf = "%"
 Picstr="<img src=''/images/hk.gif''>"
 ''取得表单栏位内容
 kmxxmc = Request.Form("kmxxmc")
 stbh = Request.Form("stbh")
  ┋ ┋ ┋
 stnr = Request.Form("stnr")
 ''调整SQL指令中的特定字元
 kmxxmc = adjust_sql(kmxxmc)
 stbh = adjust_sql(stbh)
  ┋ ┋ ┋
 stnr = adjust_sql(stnr)
 If Len(xzsj) = 0 Then cond_count = cond_count - 1
  If Len(stbh) = 0 Then cond_count = cond_count - 1
  ┋ ┋ ┋
  If Len(stnr) = 0 Then cond_count = cond_count - 1
   SQLstr = "select * from " & kmxxmc & " where "
  If Len(stbh) > 0 Then
   SQLstr = SQLstr & " stbh " & stbhfw & "''" & stbh & "''"
  If cond_count > 1 Then
   SQLstr = SQLstr & " and "
   cond_count = cond_count - 1
  End If
 End If
  ┋ ┋ ┋
 If Len(stnr) > 0 Then
  SQLstr = SQLstr & " tmnr like " & "''" & mf & stnr & mf & "''"
  If cond_count > 1 Then
   SQLstr = SQLstr & " and "
   cond_count = cond_count - 1
  End If
 End If
 SQLstr = SQLstr & " order by lr_date DESC "
 set adocon=Server.CreateObject("ADODB.Connection")
 adocon.Open "zxtest"
 set sa1 = adocon.Execute(SQLstr)
 If sa1.EOF Then
  Response.Write "<br><center><h1>"
  Response.Write "Sorry!<p>"
  Response.Write "没有找到试题,"
  esponse.Write "请重试一次!</center><p>"
  Response.Write "<hr></h1>"
 Else
  i = 0
  Response.Write "<h2>"
  Response.Write "符合条件的试题相关内容如下:"
  Response.Write "</h2>"
  While Not sa1.EOF
   i = i + 1
   Response.Write "第 <i>" & i & "</i>题 题编号:<i>" & sa1("stbh") & "</i><br>"
   Response.Write "试题内容:" & sa1("tmnr") & "<br>"
    ┋ ┋ ┋
  Response.Write "答案A:" & sa1("bxda_a") & "<br>"
  sa1.MoveNext
  WEnd
  adocon.Close
 End If
End Sub
</script>
<% ''"检索试卷"的查询方式源代码
 mf="%"
 select case request("findfs")
  case "sjbh"
   sqlstr="SELECT * FROM tbsjxx WHERE " & " sjbh LIKE"
   sqlstr=sqlstr & "''" & mf & request("findfsz") & mf & "''order by ksrq DESC"
   ┋ ┋ ┋
  case "lr

凌众科技专业提供服务器租用、服务器托管、企业邮局、虚拟主机等服务,公司网站:http://www.lingzhong.cn 为了给广大客户了解更多的技术信息,本技术文章收集来源于网络,凌众科技尊重文章作者的版权,如果有涉及你的版权有必要删除你的文章,请和我们联系。以上信息与文章正文是不可分割的一部分,如果您要转载本文章,请保留以上信息,谢谢!

分享到: 更多

Copyright ©1999-2011 厦门凌众科技有限公司 厦门优通互联科技开发有限公司 All rights reserved

地址(ADD):厦门软件园二期望海路63号701E(东南融通旁) 邮编(ZIP):361008

电话:0592-5908028 传真:0592-5908039 咨询信箱:web@lingzhong.cn 咨询OICQ:173723134

《中华人民共和国增值电信业务经营许可证》闽B2-20100024  ICP备案:闽ICP备05037997号