Asp½«²éѯ½á¹ûµ¼³öµ½excelÀï
ÊÇOfficeµÄOWC°æ±¾ÎÊÌâ¡£2000£¬2002XP£¬2003¸÷²»Ïàͬ£¬¼ÓÈëOfficeµÄ°æ±¾¼ì²é¼´¿É£¬ÍêÕû´úÂëÈçÏ£º
<script language="javascript">
function exportExcel(atblData,dirPath)
{
//alert(dirPath);
if (typeof(atblData)=="undefined"||typeof(atblData)=="unknow")
{
alert("ûÓÐÊý¾Ý¿ÉÒÔµ¼³ö£¡");
return;
}
var mysheet;
var off2000=false;
var off2002xp=false;
var off2003=false;
//office2003
try {
mysheet=new ActiveXObject("OWC11.Spreadsheet");
off2003=true;
}
catch(e) { }
//office2002-xp
if(!off2003)
{
try {
mysheet=new ActiveXObject("OWC10.Spreadsheet");
off2002xp=true;
}
catch(e) {}
}
//office 2000
&
Ïà¹ØÎĵµ£º
±¾ÑÝÁ·Í¨¹ýʹÓôúÂëе÷ͬһҳÉϵÄÁ½¸ö²Ëµ¥£¬ÑÝʾÈçºÎÒÔ±à³Ì·½Ê½Ê¹Óà ASP.NET Menu ¿Ø¼þ¡£
¿ÉÒÔʹÓà ASP.NET Menu ¿Ø¼þΪÍøÕ¾´´½¨µ¼º½²Ëµ¥¡£ÔÚ±¾ÑÝÁ·ÖУ¬½«¿¼²ì ASP.NET Menu ¿Ø¼þµÄ±à³Ì·½Ã棬²¢´´½¨Á½¸öÐͬ¹¤×÷µÄ²Ëµ¥£¬ËüÃǶ¼°ó¶¨µ½Í¬Ò»¸ö Web.sitemap Îļþ¡£µÚÒ»¸ö²Ëµ¥ÊǾ²Ì¬ÏÔʾµÄÀà±ð£¨Èç²úÆ·¡¢·þÎñºÍÖ§³Ö£©²Ëµ¥¡£Ë ......
¡¡¡¡ÔÚ±àдASP³ÌÐòµÄʱºò£¬Í¨³£¶¼»áÓõ½<!--#include virtual|file="path/filename"-->°ÑÒ»¶ÎÏà¶Ô¶ÀÁ¢µÄÎļþ´úÂëǶÌ×µ½µ±Ç°Ò³ÃæÖÐÀ´¡£ÔÚʵ¼ÊµÄʹÓÃÖкܶàÈ˶Ô"file"ºÍ"virtual"µÄʹÓò»Ì«Àí½â£¬µ¼ÖÂÒ³ÃæÖ´ÐеÄʱºò»á³öÏÖ´íÎó¡£Ï־͸ÃÎÊÌâ×÷Ò»¸ö¼òÊö¡£
¡¡¡¡Ê¹ÓÃ"file"µÄʱºò£¬µÈºÅºóÃæʹÓõÄÊÇÏà¶Ô·¾¶¡£ËùνÏච......
dataurl=Server.MapPath("menutree.mdb")'Êý¾Ý¿âµØÖ·
dim conn,strQuery,rs
set conn = server.CreateObject("adodb.connection")
conn.Open "PROVIDER=MICROSOFT.JET.OLEDB.4.0;DATA SOURCE="&dataurl
strQuery="select * from menufun"
set rs=server.createobject("adodb.recordset")
rs.open strQuery,conn,1 ......
×î½ü×öÒ»¸öÓÃasp×öµÄÍøÕ¾ºǫ́µÄÊý¾Ýµ¼³ö¹¦ÄÜʱ,google,baiduÁ˺ܶà,µ«ÊǶàÊý¶¼ÊÇתÔØ,´úÂë´ó¸Å¶¼Ò»Ñù,µ«ÊǾÍÊDZ¨´í,×îºóÓÐÈË˵ͨ¹ýÉèÖÃMIMEÀàÐͺͽ¨Á¢Ä£°å,×îºóÕûÀí,²âÊÔÎÊÌâÖÕÓÚ½â¾ö.¹Ø¼üµÄµØ·½ÓÐÒÔϼ¸µã:
1):MIMEÀàÐÍÒªÉèÖÃÕýÈ·,ÈçÒª°ÑDBÖбí(»ò±íÖÐÖ¸¶¨×Ö¶Î)µÄÊý¾Ýµ¼³ö³Éexel¸ñʽʱ,Í·²¿µÄMEMIÀàÐ͵ÄÉèÖÃÊÇ:
<%
......