DW显示sql server表格的时候成功显示内容 但仍然报错

大琳 发布于 2014/11/07 14:57
阅读 232
收藏 0
<%@LANGUAGE="VBSCRIPT"%>
<!--#include file="Connections/restaurant.asp" -->
<%
Dim Material
Dim Material_cmd
Dim Material_numRows


Set Material_cmd = Server.CreateObject ("ADODB.Command")
Material_cmd.ActiveConnection = MM_restaurant_STRING
Material_cmd.CommandText = "SELECT * FROM dbo.Material" 
Material_cmd.Prepared = true


Set Material = Material_cmd.Execute
Material_numRows = 0
%>
<%
Dim Repeat1__numRows
Dim Repeat1__index


Repeat1__numRows = -1
Repeat1__index = 0
Material_numRows = Material_numRows + Repeat1__numRows
%>
<!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>
<style type="text/css">
body {
background-image: url(Image/4a55d354c8f7df135b8eb8b93fe10327.png);
background-repeat: no-repeat;
}
#apDiv1 {
position: absolute;
width: 200px;
height: 115px;
z-index: 1;
left: 826px;
top: 94px;
}
#apDiv2 {
position: absolute;
width: 639px;
height: 455px;
z-index: 2;
left: 86px;
top: 157px;
}
#apDiv3 {
position: absolute;
width: 200px;
height: 115px;
z-index: 3;
left: 85px;
top: 634px;
}
#apDiv4 {
position: absolute;
width: 200px;
height: 115px;
z-index: 4;
left: 421px;
top: 636px;
}
#apDiv5 {
position: absolute;
width: 149px;
height: 45px;
z-index: 5;
left: 989px;
top: 736px;
font-family: "黑体";
font-size: 36px;
}
</style>
</head>


<body>
<div id="apDiv1"><img src="Image/1414142879_712050.png" width="343" height="109" /></div>
<div id="apDiv2">
  <table  height="414" width="600" border="1">
    <tr>
      <td width="92" height="105">原材料ID</td>
      <td width="164">原材料名</td>
      <td width="92">库存量</td>
      <td width="142">保质期</td>
      <td width="76">单价</td>
    </tr>
    <% 
While ((Repeat1__numRows <> 0) AND (NOT Material.EOF)) 
%>
      <tr>
        <td height="60"><%=(Material.Fields.Item("Mid").Value)%></td>
        <td><%=(Material.Fields.Item("Mname").Value)%></td>
        <td><%=(Material.Fields.Item("Minventory").Value)%></td>
        <td><%=(Material.Fields.Item("MEXP").Value)%></td>
        <td><%=(Material.Fields.Item("Mprice").Value)%></td>
      </tr>
      <% 
  Repeat1__index=Repeat1__index+1
  Repeat1__numRows=Repeat1__numRows-1
  Material.MoveNext()
Wend
%>
<tr>
      <td height="59"><%=(Material.Fields.Item("Mid").Value)%></td>
      <td><%=(Material.Fields.Item("Mname").Value)%></td>
      <td><%=(Material.Fields.Item("Minventory").Value)%></td>
      <td><%=(Material.Fields.Item("MEXP").Value)%></td>
      <td><%=(Material.Fields.Item("Mprice").Value)%></td>
    </tr>
    <tr>
      <td height="55"><%=(Material.Fields.Item("Mid").Value)%></td>
      <td><%=(Material.Fields.Item("Mname").Value)%></td>
      <td><%=(Material.Fields.Item("Minventory").Value)%></td>
      <td><%=(Material.Fields.Item("MEXP").Value)%></td>
      <td><%=(Material.Fields.Item("Mprice").Value)%></td>
    </tr>
    <tr>
      <td height="58"><%=(Material.Fields.Item("Mid").Value)%></td>
      <td><%=(Material.Fields.Item("Mname").Value)%></td>
      <td><%=(Material.Fields.Item("Minventory").Value)%></td>
      <td><%=(Material.Fields.Item("MEXP").Value)%></td>
      <td><%=(Material.Fields.Item("Mprice").Value)%></td>
    </tr>
    <tr>
      <td height="61"><%=(Material.Fields.Item("Mid").Value)%></td>
      <td><%=(Material.Fields.Item("Mname").Value)%></td>
      <td><%=(Material.Fields.Item("Minventory").Value)%></td>
      <td><%=(Material.Fields.Item("MEXP").Value)%></td>
      <td><%=(Material.Fields.Item("Mprice").Value)%></td>
    </tr>
   
  </table>
</div>
<div id="apDiv3"><img src="Image/上一页.png" width="255" height="91" /></div>
<div id="apDiv4"><img src="Image/下一页.png" width="255" height="91" /></div>
<div id="apDiv5"><a href="菜单.asp">回主菜单</a></div>
</body>
</html>
<%
Material.Close()
Set Material = Nothing
%>
<%
Recordset1.Close()
Set Recordset1 = Nothing
%>



加载中
返回顶部
顶部