asp¶ÁÈ¡ExcelÎļþ
1.ASP¶ÔExcelµÄ»ù±¾²Ù×÷
(1) ½¨Á¢Excel¶ÔÏó
´´½¨Excel¶ÔÏó¿ÉÒÔͨ¹ýÏÂÃæµÄ´úÂëÀ´ÊµÏÖ:
<%
set objExcelApp = CreateObject("Excel.Application")
objExcelApp.DisplayAlerts = false ’²»ÏÔʾ¾¯¸æ
objExcelApp.Application = false ’²»ÏÔʾ½çÃæ
%>
(2) н¨ExcelÎļþ
н¨ExcelÎļþ¿ÉÒÔͨ¹ýÒÔÏ´úÂëÀ´ÊµÏÖ:
<%
objExcelApp.WorkBooks.add
set objExcelBook = objExcelApp.ActiveWorkBook
set objExcelSheets = objExcelBook.Worksheets
set objExcelSheet = objExcelBook.Sheets(1)
%>
(3) ¶ÁÈ¡ÒÑÓеÄExcelÎļþ
¶ÁÈ¡ÒÑÓеÄExcelÎļþ¿ÉÒÔͨ¹ýÏÂÃæµÄ´úÂëÀ´ÊµÏÖ
<%
strAddr = Server.MapPath(".")
objExcelApp.WorkBooks.Open(strAddr & "TempletTable.xls")
set objExcelBook = objExcelApp.ActiveWorkBook
set objExcelSheets = objExcelBook.Worksheets
set objExcelSheet = objExcelBook.WorkSheets(1)
%>
(4) Áí´æExcelÎļþ
Áí´æExcelÎļþ¿ÉÒÔͨ¹ýÒÔÏ´úÂëÀ´ÊµÏÖ
<%
objExcelBook.SaveAs strAddr & "templateTables.xls"
%>
(5) ±£´æExcelÎļþ
±£´æExcelÎļþ¿ÉÒÔͨ¹ýÒÔÏ´úÂëÀ´ÊµÏÖ:
<%
objExcelBook.Save
%>
(6) Í˳öExcel²Ù×÷
<%
objExcelApp.Quit ’Ò»¶¨ÒªÍ˳ö
set objExcelApp = nothing
%>
2 ¶ÁÈ¡ExcelÎļþµÄʵÀý
<%
set xlApp = server.CreateObject("Excel.Application")
strsource = server.MapPath("xl.xls")
set xlbook = xlApp.WorkBooks.Open(strsource)
set xlsheet = xlbook.Worksheets(1)
i = 1
response.write "<table>"
while xlsheet.cells(i,1) <> ""
response.write "<tr>"
response.write "<td>" & xlsheet.Cells(i,1) & "</td>"
response.write "<td>" & xlsheet.Cells(i,2) & "</td>"
response.write "<td>" & xlsheet.Cells(i,3) & "</td>"
response.write "<tr>"
i = i + 1
wend
response.write "</table>"
set xlsheet = nothing
set xlbook = nothing
xlApp.quit
‘ǧÍò¼ÇסҪ¼ÓÕâÒ»¾ä£¬·ñÔòÿÔËÐÐÒ»´ÎÄãµÄ»úÆ÷Àï¾ÍÔö¼ÓÒ»¸öExcel½ø³Ì£¬¶øÇÒÎÞ·¨ÊÍ·Å
’set xlApp = not
Ïà¹ØÎĵµ£º
HTML:
<META HTTP-EQUIV="pragma" CONTENT="no-cache">
<META HTTP-EQUIV="Cache-Control" CONTENT="no-cache, must-revalidate">
<META HTTP-EQUIV="expires" CONTENT="Wed, 26 Feb 1997 08:21:57 GMT">
<META HTTP-EQUIV="expires" CONTENT="0">
PHP£º
header("Expires: Mon, 26 Jul 1997 ......
¡¡¡¡ J2MEÊÇÀûÓÃHttpConnection½¨Á¢HTTPÁ¬½Ó£¬È»ºó»ñÈ¡Êý¾Ý£¬ASPÒ²ÊÇÀûÓÃHTTPÐÒ飬Òò¶ø¿ÉÒÔÀûÓÃJ2MEÓëASP½¨Á¢Á¬½Ó£¬´Ó¶ø·ÃÎÊÊý¾Ý¿â¡£
¡¡¡¡ ASPÊÇMicroSoft¹«Ë¾µÄ·þÎñÆ÷¶Ë¶¯Ì¬Ò³Ãæ¼¼Êõ£¬¿ÉÒÔ¸ù¾ÝÇëÇóÔËÐзþÎñÆ÷¶Ë³ÌÐòÈ»ºó·µ»Ø½á¹û£¬ÕâÒ²¸øMIDPÌṩºÜ¶àÓÐÓõŦÄÜ¡£ÓÉÓÚMIDP¿Í»§¶Ë´¦ÀíÄÜÁ¦²»Ç¿£¬Òò´Ë¿ÉÒÔ°ÑһЩ´¦ÀíÈÎÎñ·ÅÔ ......
»·¾³¹¤¾ß£º
Visual studio 2008/2005
IIS 6.0
µ÷ÊÔ²½ÖèÈçÏÂ:
(1) IISÆôÓõ÷ÊÔ
1. ¼ÆËã»ú¹ÜÀí->·þÎñºÍÓ¦ÓóÌÐò->InternetÐÅÏ¢·þÎñ->ÍøÕ¾->ĬÈÏÍøÕ¾->ÊôÐÔ
2. Ö÷Ŀ¼->Ó¦ÓóÌÐòÅäÖÃ->µ÷ÊÔ
3. ÆôÓÃASP·þ ......
»·¾³£ºÊý¾Ý¿â oracle 64bit ϵͳ win2008 64bit IIS7 ÔÚasp ÍøÒ³ÖÐʹÓÃadoÁ¬½ÓÊý¾Ý¿â ODBCÓõÄÊÇMicrosft ODBC for oracle
Çé¿ö£ºÔÚÍøÒ³µÄ²éѯÓï¾äÖв»º¬ÖÐÎĵĿÉÒÔ£¬Ö»ÒªÓï¾äÖк¬ÓÐÖÐÎľͻ᷵»Ø´íÎó½á¹û¡£
Èç:select 'Ò»¶þÈý' from dual;ÕâÑùµÄÓï¾ä ·µ»Ø»ØÀ´¾ÍÊÇ£¿£¿£¿
»¹ÒªËµÃ÷µÄÊÇoracleµÄ×Ö·û¼¯ÊÇAMERICAN_AMERICA.U ......
¸Õ¸Õ ¿´µ½Õâôһ¸öÎÊÌ⣬ÕâÀïÒ²×ö¸ö±ê¼Ç£ºhttp://topic.csdn.net/u/20080411/14/7b0f9da5-0413-4149-91e9-72c3df3018a3.html?seed=327251592
µÚÒ»ÖÖ·½Ê½£º
//ÔÚVisual Studio 2008Öе÷ÊÔͨ¹ý
testPop_Page.aspx:Ö÷Ò³ÃæASPX´úÂë
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
  ......