????? ??? ????? ASP ??????? Excel ?? IE ?? ????? MIME

?????? ????????? ?????? ?????????
???? ???????: 199841 - ??? ???????? ???? ????? ????? ??? ???????.
????? ???? | ?? ????

?? ??? ??????

??????

????? ?? ??? ?????? ??? ?? ????? HTML, ????? ????? ?????????? ?? ???? ??? ???????? ?? Microsoft Excel. ???? ??? ??????? ????? ????? ???? ??? ?? ????? ???????? ???? ?? ?????? ????? ?? Microsoft SQL Server ????? ???? ?? Excel ???? ???????? ?? ???? ????? ????? ???? ??? ?? ??? MIME ?? Excel.

??????? ????

??????? ?? ??????? ?? ?????? ??????? ????? ??? ???:
  • Microsoft Windows NT Server 4.0 SP3
  • Microsoft ???? ??????? ?????? (IIS) ? ??????? 4.0 ?? ??????
  • Microsoft SQL Server 6.5 ?? ????
  • Microsoft Excel 97 ? Excel 2000 ?Excel 2002

??????? ???? ?????

  1. ????? ???? DSN ???? pubs (???????? ")" ??????? ODBC ?? ?????? ???? ??????. ????? DSN ???? ???? SQL Server ??????? ??????? ?????? SQL ???????? "pubs (????????)" ??? ????? ???????? ??????????. ???? ????? ?????? ????????? ??? ????? ?????? pubs (????????) ?? sa ?? ??? ???? ????.
  2. ??????? Notepad.exe ?????? ??? ???? XlTest.asp ?? ?????? ??????? IIS (??? ???? ??????? inetpub\wwwroot) ?????? ??????? ????:
    <%@ Language=VBScript %>
    <%
       'Change HTML header to specify Excel's MIME content type
       Response.Buffer = TRUE
       Response.ContentType = "application/vnd.ms-excel"
    %>
    <HTML>
    <BODY>
    Here is the info you requested.<p>
    <%
       ' Create ADO Connection object
       dim myConnection
       set myConnection = CreateObject("ADODB.Connection")
       
       ' Open SQL Server Pubs database...
       ' myConnection.Open "DSN=pubs;UID=sa"
       
       ' Get a recordset of info from Authors table...
       sqlStr = "SELECT au_fname,au_lname,phone FROM authors"
       set rsAuthors =  myConnection.Execute(sqlStr)
    %>
    
    <!-- Our table which will be translated into an Excel spreadsheet -->
    <TABLE WIDTH=75% BORDER=1 CELLSPACING=1 CELLPADDING=1>
    <TR>
       <TD><font size=+2>First Name</font></TD>
       <TD><font size=+2>Last Name</font></TD>
       <TD><font size=+2>Phone</font></TD>
    </TR>
    <!-- server-side loop adding Table entries -->
    <% do while not rsAuthors.EOF %>
    <TR>
       <TD><%=rsAuthors("au_fname")%></TD>
       <TD><%=rsAuthors("au_lname")%></TD>
       <TD><%=rsAuthors("phone")%></TD>
    </TR>
    <% rsAuthors.MoveNext
       loop
       ' Clean up
       rsAuthors.Close
       set rsAuthors = Nothing
       myConnection.Close
       set myConnection = Nothing
    %>
    </TABLE>
    </BODY>
    </HTML>
    						
  3. ??? XlTest.asp ?? ?? ?????? ?? ?????? ????. /XlTest.asp MyServer http:// ??? ???? ??????? (??????? MyServer ???? ?????? ????? ??.)
?? ???? ????? Microsoft Excel 97 ??? ???? ????????? ?????? ???? Microsoft Excel ???????? ???? ????????.

???????

???? ???????: 199841 - ????? ??? ??????: 27/????? ??????/1425 - ??????: 5.4
????? ???
  • Microsoft Visual InterDev 6.0 Standard Edition
  • Microsoft Internet Information Server 4.0
  • Microsoft Internet Information Services 5.0
  • Microsoft Excel 97 Standard Edition
  • Microsoft Excel 2000 Standard Edition
  • Microsoft Excel 2002 Standard Edition
  • Microsoft Office Excel 2003
????? ??????: 
kbmt kbhowto KB199841 KbMtar
????? ????
???: ??? ????? ??? ?????? ???????? ?????? ????? ???? ????? ?????????? ????? ?? ????????? ?????? ????. ???? ???? ?????????? ???? ?? ???????? ???????? ?????? ????????? ????? ????????? ???????? ????? ???????? ?????? ?? ?????? ??? ?? ???????? ???????? ?? ????? ??????? ?????? ??? ??????? ?????? ??. ?????? ?? ???? ??? ??????? ???????? ????? ?? ???? ????? ?????? ??? ????? ??? ????? ??????? ?? ????? ?? ?????? ??? ??? ??????? ??????? ?? ????? ????? ????? ????? ?????. ?? ????? ???? ?????????? ??????? ??? ????? ?? ??????? ?? ????? ?????? ?? ??? ????? ?? ????? ??????? ?? ???????? ?? ??? ???????. ???? ???? ?????????? ???????? ??? ????? ?????? ??????? ??????
???? ??? ????? ??????? ?????? ??????????199841

????? ???????

 

Contact us for more help

Contact us for more help
Connect with Answer Desk for expert help.
Get more support from smallbusiness.support.microsoft.com