结果是什么也不显示

也不报错

 

<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>无标题文档</title>
   <%
   dim  strServer,strUid,strPwd,strDatabase
   strServer="(local)"
   strU
   strPwd=""
   strDatabase="jiandan"
  
   Dim Conn '数据库连接
   Dim StrDSN '数据库连接字符串
   Dim Rs '命令字符串
  
   StrDSN="driver={SQL server};server="&StrServer&";u&strDatabase
  
   set Conn=server.CreateObject("ADODB.Connection")
   set rs=server.CreateObject("ADODB.RecordSet")
   Conn.open StrDSn
  
   dim strsql
  
   sub readdb()
   strsql="select * from student"
   rs.open strsql,Conn,1,1
   if rs.EOF then response.write "no record at all":exit sub
   response.write "<table border=1>"
   response.write "<tr>"
   for i=0 to rs.Fields.Count-1
   response.write "<td><font color=blue>"&rs.Fields(i).Name&"</font></td>"
   next
   response.write "</tr>"
   while not rs.EOF
   response.write "<tr>"
   for i=0 to rs.Fields.Count-1
   response.write "<td>"&rs.Fields(i).Value&"</td>"
   next
   response.write "</tr>"
   rs.MoveNext
   wend
   response.write "</table>"
   rs.Close
   set rs=nothing
   Conn.close
   set Conn=nothing
   end sub
  


%>

</head>

 


<body>
</body>
</html>

相关文章:

  • 2021-10-16
  • 2021-10-23
  • 2022-01-27
  • 2021-12-22
  • 2021-11-23
  • 2022-01-15
  • 2022-01-05
  • 2021-09-05
猜你喜欢
  • 2021-11-01
  • 2021-11-18
  • 2021-06-26
  • 2022-12-23
  • 2021-07-04
  • 2021-08-20
  • 2021-08-22
相关资源
相似解决方案