test.asp
上传用户:mingda
上传日期:2017-06-20
资源大小:27691k
文件大小:2k
- <%@ LANGUAGE = VBScript %>
- <HTML xmlns:fc>
- <HEAD>
- <STYLE>
- @media all
- {
- fc:fc_code
- {
- behavior: url(webprint/fc_code.htc) ;
- }
- fc:webprint
- {
- behavior: url(webprint/webgrid.htc) ;
- }
- }
- </STYLE>
- <SCRIPT ID=clientEventHandlersJS LANGUAGE=javascript>
- <!--
- function window_onload() {
- //初始化表格的位置
- grid.left=5
- grid.top=80
- grid.width=700
- grid.height=300
- }
- //-->
- </SCRIPT>
- </HEAD>
- <BODY onload="return window_onload()">
- 用鼠标拖动可修改行高和列宽<BR>
- <input type=button value="打印" onclick="grid.print()" >
-
- <%
- mDBFile = "webprint/DataDB1.mdb"
- mTable = "Publishers"
- mQueryString = "SELECT Name,[Company Name],State FROM " & mTable
- mMapPath = Server.MapPath(mDBFile)
- Set oConn = Server.CreateObject("ADODB.Connection")
- oConn.Open "PROVIDER=Microsoft.Jet.OLEDB.4.0;" & "Data Source=" & mMapPath & ";"
- Set oRs = oConn.Execute(mQueryString)
- %>
- <fc:webprint id="grid" >
- <table id=t cellPadding=0 cellSpacing=0 frame=box style="BORDER-COLLAPSE: collapse; FONT-SIZE: 13px; LEFT: 0px; POSITION: absolute; TABLE-LAYOUT: fixed; TOP: 0px; " bgColor=white borderColor=black>
- <colgroup><col style="WIDTH: 150px"><col style="WIDTH: 350px"><col style="WIDTH: 50px"></colgroup>
- <tr style="height:21">
- <td>
- Name
- </td>
- <td>
- Company Name
- </td>
- <td>
- State
- </td>
- </tr>
- <%
- '以下语句未执行,故得不到由数据库生成的表
- Do while (Not oRs.eof) %>
- <tr style="height:21">
- <% For Index=0 to (oRs.fields.count-1) %>
- <TD ><%Response.Write oRs(Index)%></TD>
- <% Next %>
- </tr>
- <% oRs.MoveNext
- Loop
- %>
- </TABLE>
- </fc:webprint>
- <%
- oRs.close
- oConn.close
- %>
-
- </BODY>
- </HTML>