急求把Access里面的数据写入word 的代码!!在线等

BeerWang 2003-10-20 08:59:47
我想把Access里面的数据读出然后写入word模板里
在线用代码生成有表格的word更好

哪位大侠有这方面的代码呀
救救老弟!!
...全文
62 2 打赏 收藏 转发到动态 举报
写回复
用AI写文章
2 条回复
切换为时间正序
请发表友善的回复…
发表回复
BeerWang 2003-10-20
  • 打赏
  • 举报
回复
这个我懂了
但我要的是存为word文件而不是在IE中调用word打开它
孟子E章 2003-10-20
  • 打赏
  • 举报
回复
<%@ Language=VBScript %>
<%
Dim a
a=Request.form("aa")
Response.Buffer = false
Response.ContentType = "application/vnd.ms-excel"
%>
<table border="1">
<tr>
<th bgcolor="red">项目 A</th>
<th>项目 B</th>
<th>合计</th>
<th>项目 C</th>
<th>项目 D</th>
<th>合计</th>
</tr>
<tr>
<td height="30" bgcolor="red">a<%Response.Write a%></td>
<td>3</td>
<td>5</td>
<td>6</td>
<td>7</td>
<td><font color="red">=sum(a2:e2)*100</font></td>
</tr>
<tr>
<td>2</td>
<td>1</td>
<td colspan="4"><font color="red">=sum(a3:b3)+f2</font></td>
</tr>
</table>


其实把数据输出,在前面加
Response.ContentType = "application/msword"即可

28,390

社区成员

发帖
与我相关
我的任务
社区描述
ASP即Active Server Pages,是Microsoft公司开发的服务器端脚本环境。
社区管理员
  • ASP
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧