Ò׽ؽØͼÈí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

°ÑaccessÊý¾Ý¿âµ¼Èëexcel±í¸ñ


    public void ExportExcel(DataTable dtData, string filename)
    {
        System.Web.UI.WebControls.DataGrid dgExport = null;
        // µ±Ç°¶Ô»°
        System.Web.HttpContext curContext = System.Web.HttpContext.Current;
        // IOÓÃÓÚµ¼³ö²¢·µ»ØexcelÎļþ
        System.IO.StringWriter strWriter = null;
        System.Web.UI.HtmlTextWriter htmlWriter = null;
        if (dtData != null)
        {
            // ÉèÖñàÂëºÍ¸½¼þ¸ñʽ
            curContext.Response.AppendHeader("Content-Disposition", "attachment;filename=" + HttpUtility.UrlEncode(filename) + ".xls");//¼ÓHttpUtility.UrlEncode()·½·¨´¦ÀíÎļþÃûÂÒÂë
            curContext.Response.Charset = "gb2312";
            curContext.Response.ContentEncoding = System.Text.Encoding.GetEncoding("gb2312");
            //HttpContext.Current.Response.ContentType=".xls/.txt/.doc";image/JPEG;text/HTML;image/GIF;vnd.ms-excel/msword
            curContext.Response.ContentType = ".xls";
            // µ¼³öexcelÎļþ
            strWriter = new System.IO.StringWriter();
            htmlWriter = new System.Web.UI.HtmlTextWriter(strWriter);
            // ΪÁ˽â¾


Ïà¹ØÎĵµ£º

Ô¶³ÌÁ¬½ÓaccessÊý¾Ý¿âµÄ¼¸¸ö·½·¨£º

ʹÓÃÁËTCP/IP£¬ADO¼°XML£¨ÐèÒª°²×°Microsoft XML 4.0¡££©¡£·Ö·þÎñÆ÷ºÍ¿Í»§¶ËÁ½²¿·Ö£¬·þÎñÆ÷¿ÉÒÔ¶àÓû§Í¬Ê±Á¬½Ó¡£Ô¶³ÌÁ¬½ÓAccessÊý¾Ý¿âÓкܶ෽·¨£¬ÎÒÒÔÇ°ÒѾ­±È½Ï¾ßÌåµÄ»Ø´ð¹ý£¨¼ûÏÂÃæËùÁеÄ5ÖÖ·½·¨£©£¬ÎÒÏÖÔÚÕâ¸öÀý×ÓÊôÓÚÆäÖеĵڣ³ÖÖ·½·¨£¨²»ÐèҪʹÓÃRDS»òWeb·þÎñÆ÷£©¡£
Ô¶³ÌÁ¬½ÓaccessÊý¾Ý¿âµÄ¼¸¸ö·½·¨£º
£±£®½¨Á¢VPN ......

AccessÎÞ·¨Ê¹ÓÃtime×÷Ϊ×Ö¶ÎÃû³Æ

         Õ⼸Ìì°ïͬѧ×öÒ»¸öСµÄ¹ÜÀíϵͳ£¬B/S½á¹¹µÄ£¬ÓÉÓںܾÃûÓÐ×öB/S½á¹¹µÄ¶«Î÷ÁË£¬×öµÄʱºòºÜÉúÊè¡£Ò»¸öÏÂÎ磬Óöµ½ÁËÒ»¸öÎÊÌ⣺ÍùAccessÀï²åÈëÊý¾ÝµÄʱºò£¬ÀÏÊÇÌáʾÎÒsqlÓï¾ä´íÎ󣬵«ÊǾͺÜÄÉÃÆÁË£¬ÕâÖÖsqlÓï¾äдÁ˲»ÏÂ500±éÁË°É£¬¾ÍËãÊÇ×öÃÎÒ²²»»áд´íµÄ£¬Ôõô»ØÊ£¿sqlÓï¾ ......

Ò»¸ö¼òµ¥µÄASP.NET +ACCESS µÇ¼

Ê×Ò³£º
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %>
<!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 ......

Windows 2008 IIS access·ÃÎÊÊý¾Ý¿â±¨´í

¹ÊÕÏÏÖÏó:
Windows 2008 64λϵͳ,aspÍøÒ³·ÃÎÊaccessÊý¾Ý¿â±¨ÈçÏ´íÎó.
Ïà¹Ø´úÂë
set conn=server.CreateObject("adodb.connection")
set rs=server.CreateObject("adodb.recordset")
connstr="provider=microsoft.jet.oledb.4.0;data source="&server.mappath("db/db.mdb")
conn.open connstr
sql="select * fr ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ