Ò׽ؽØͼÈí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö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µ¼ÈëSQL server

Ò»¡¢SQL SERVER ºÍACCESSµÄÊý¾Ýµ¼Èëµ¼³ö
³£¹æµÄÊý¾Ýµ¼Èëµ¼³ö£º
ʹÓÃDTSÏòµ¼Ç¨ÒÆÄãµÄAccessÊý¾Ýµ½SQL Server£¬Äã¿ÉÒÔʹÓÃÕâЩ²½Öè:
¡¡¡¡¡ð1ÔÚSQL SERVERÆóÒµ¹ÜÀíÆ÷ÖеÄTools£¨¹¤¾ß£©²Ëµ¥ÉÏ£¬Ñ¡ÔñData Transformation
¡¡¡¡¡ð2Services£¨Êý¾Ýת»»·þÎñ£©£¬È»ºóÑ¡Ôñ  czdImport Dat ......

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

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

ʹÓÃPerlÁ¬½ÓAccessÊý¾Ý¿âÏê½â

Ç°ÌâÊDZØÐë°²×°ºÃactiveperl £¨505ÒÔÉÏ£©£¬ÒÔ¼°MS Access 97
¡¡¡¡
¡¡¡¡Ò».
°²×°Win32-ODBCÄ£¿é
¡¡¡¡²½Öè1£º
¡¡¡¡´ÓTOOLSÀ¸Ä¿ÖÐÏÂÔØWin32-ODBC.zip,ÏÂÔØÍêºóÓÃwinzip½â¿ªµ½Ò»¸ötempĿ¼,¹²ÓÐÈý¸öÎļþ£º
¡¡¡¡Readme
¡¡¡¡Win32-ODBC.ppd
¡¡¡¡Win32-ODBC.tar.gz
¡¡¡¡²½Öè2£º
¡¡¡¡ÔÚDOS´°¿ÚÏ£¬tempĿ¼ÖÐÔËÐÐÏÂÃæµÄD ......

asp.netÁ´½ÓAccessÊý¾Ý¿â×Ö·û´®ÕýÈ··½·¨

ÔÚweb  configÖР ×÷ÈçÏÂÅäÖãº
<connectionStrings>
    <add name="ydycon" connectionString="Provider=Microsoft.Jet.OLEDB.4.0;
Data Source=|DataDirectory|ydy.mdb" providerName="System.Data.OleDb"/>
 
  </connectionStrings>
ÔÚ.netÎļþÖÐÓ¦ÓÃÁ´½Ó ......

accessº¯Êý²Î¿¼

ÈÕÆÚ/ʱ¼ä
CDate  ½«×Ö·û´®×ª»¯³ÉΪÈÕÆÚ select CDate("2005/4/5")
Date  ·µ»Øµ±Ç°ÈÕÆÚ
DateAdd  ½«Ö¸¶¨ÈÕÆÚ¼ÓÉÏij¸öÈÕÆÚselect dateAdd("d",30,Date())½«µ±Ç°ÈÕÆÚ¼ÓÉÏ30Ìì,ÆäÖÐd¿ÉÒÔ»»Îªyyyy»òHµÈ
DateDiff ÅжÏÁ½¸öÈÕÆÚÖ®¼äµÄ¼ä¸ô select DateDiff("d","2006-5-1& ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ