<%@ page language="java" import="java.sql.*,java.util.*,com.zhuozhengsoft.pageoffice.*" pageEncoding="gb2312"%>
<%@ taglib uri="http://java.pageoffice.cn" prefix="po" %>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
  	<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
    <title></title>
  </head>
  
  <body>
    <%
    String id = request.getParameter("id");
	String sType = request.getParameter("type");
	String htmlFile = "";

	if (sType.equals("word")) {
		htmlFile = "aabb" + id + ".mht";
	}
	
		Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");//载入驱动程序类别
		String strUrl = "jdbc:odbc:driver={Microsoft Access Driver (*.mdb)};DBQ="
			+ this.getServletContext().getRealPath("demodata/") + "\\demo.mdb";
		Connection conn = DriverManager.getConnection(strUrl);
		Statement stmt = conn.createStatement();
    	String strsql = "update " + sType + "  set htmlFile='" + htmlFile
			+ "' where id="+id;
		stmt.execute(strsql); 
		stmt.close();
		conn.close();
		response.sendRedirect("doc/" + htmlFile);
     %>
  </body>
</html>
