????? ????????? ????????? Excel ????? ???????? ADO ?? ASP

?????? ????????? ?????? ?????????
???? ???????: 195951 - ??? ???????? ???? ????? ????? ??? ???????.
????? ???? | ?? ????

?? ??? ??????

??????

???? ??? ?????? ????? ????????? ?????? ??????? ?? ???? ?????? Excel ???????? ?????? ?????? ActiveX (ADO) ?? ???? ????? ???? ?????? (ASP). ??? ???? ??? ??????? ?????? ???????? ?? ??? ????? ?? ???????.

???: ??? ??????? ASP/ADO ??? ?????? ????? ??????????, ???? ?????? Excel ??. ?????? ?? ???? ??? ??????? ?? ????????? ?? ??????? ?????? ?????? ????????? ????? ??????????.

??????? ????

?????? ??? ???????? ?? ???? ?????? Excel ?????? ?? ?????? ??? ??? ?????? ? ?????? ?????? ????? ODBC Microsoft Excel. ????? ???? ?????? ??? ???????? ?? ???? ????? ???? ???? ?? ???? Excel.

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

  • ????? ??? Excel ADOtest.xls ?? ???????? ??????? ?? sheet1:

    ?? ??? ??????????? ??? ??????
    column1column2column3
    rr ???15
    bb??????20
    ???????25

    ?????? ??? ??? ???? ?? ???? Excel ????? ??? ???? ???????? ?? ?????? ?????? ????? ODBC Excel ???? ???? ????? ??? ???????? ???? ??? ?? ???? ??????. ?????? ?????? ?? ?? ???? ??????? ?? ???? ?? ??? ??? ????????. ???? ?? ???? ??????? ??????? ??????? ??? ?? ??? ?? ???? ?? ???? ?? ??? ????? ?? ???? ????? ?????? ??? "????" ? "???":
    1. ???? Microsoft OLE DB ?? ??? ????? ????? ODBC '80040e21'
      ???? ?? ???? ????? ????? ??? ?????? ?? ??? ?????? ????? ODBC ???.
    2. ???? Microsoft OLE DB ?? ??? ????? ????? ODBC '80004005'
      ????????? ??? ???? ??????? ???? ????? ??? ?? ????? ????? ????? ???? ??????? ??????? ?????.
    3. ???? Microsoft OLE DB ?? ??? ????? ????? ODBC '80004005'
      ??? ????? ???????? ??? ???????. ???? ?????? ??? ???? ??? ?????.
  • ????? ???? ???? myRange1, ?? ???? ????????:

    1. ????? ????? ???? (??????) "?" ?????? (???????) ??? ???? ???????? ?????? ??.
    2. ?? ??????? ?????? ??? ??? ??? ?? ???? ??? ?????.
    3. ???? myRange1 ??? ?????? ?????? ???.
    4. ???? ??? ?????.
    myRange1 ???? ???? ????? ??? ???????? ???????:

    ?? ??? ??????????? ??? ??????
    column1column2column3
    rr???15
    bb??????20
    ???????25


    ?????? ????? ADO ???? ????? ?? ??????? Excel ????? ??? ???? ???????. ????? ??? ?? ????? ???? ???? ?????? ???????. ??? ?? ?????? ?????? ?? DAO.

    ?????? ?? ???? ?? ???? ?????? ??????? ?????. ?????? ????? Excel ?? ???? ????? ??? ?????? ? ????? ?? ??? ???? ????. ??? ???? ??????? ????? ???? ?? "F1" ?????? ???? ??? ????.
  • ????? ODBC ?????? ??? ???? ???????? (DSN) ???? ??? ??? ADOTest.xls.
    1. ?? "???? ???????" ???? ODBC ???????.
    2. ?? ????? ??????? "???? DSN" ? ???? ??? ?????.
    3. ??? ?????? ????? Microsoft Excel (*.xls) ?? ???? ??? "?????". ?? ???? ??? ???? ??? ?????? ????? ??? ????? ?????? ????? ODBC Microsoft Excel ?? ?????? ??????? "Excel.
    4. ?????? ADOExcel ??? ???? ????????.
    5. ???? ?? ????? ??????? ??? ??????? ?????? ?? Excel.
    6. ???? ??? "?????... ??????" ? ??????? ?????? ??? ADOTest.xls ????? ?? ???? ??? ?????.
    7. ???? ??? "?????? >>" ???? ??? ?????? ????? ???? ???????? "??????? ???".
    8. ???? ??? ????? ?? ???? ??? ????? ??? ????.
  • ????? ???????? ??? ????? ADOTest.xls.
??? ??? ???? "???? ?????? ??????" ??? ?????? ????? ?? ??? ?????, ????? ??? ?????? ?? ?? "?????? ???????" (IUSR_ <machinename>) ???? ??? ????? ???????/??????? (RW) ?????? ??? ???? ????????. ??? ??? ???? ??? ??????? ?? ???? ???????? ????? ??? ??? ???????? ????? ????.

??? ??? ??? ?????? ?????? ??? "???? ?????? ??????" ?????? ?? ? ???? ?????? ?? ?? ???? ?????????? ????? ????? ??? ??????? ????? ?? ?? ???? ???? ???????? ????????.

?????? ??? ?? ????? ???????? ???????? ??? ???? ???????? ?????? ????? ??? ?????? ??? ???:

???? Microsoft OLE DB ?? ????? ????? ODBC ????? '80004005'

[Microsoft][?????? ????? Excel ODBC] Microsoft Jet ?? ???? ??? ???? ????? ?????? ??? '(??? ?????)'. ?????? ?????? ???? ??? ?? ??? ?????? ??? ?? ????? ??? ??? ???? ???????.
  1. ????? ???? ASP ????? ?????? ?? ???????? ???????? ???????:
          <!-- Begin ASP Source Code -->
          <%@ LANGUAGE="VBSCRIPT" %>
          <%
            Set objConn = Server.CreateObject("ADODB.Connection")
            objConn.Open "ADOExcel"
    
            Set objRS = Server.CreateObject("ADODB.Recordset")
            objRS.ActiveConnection = objConn
            objRS.CursorType = 3                    'Static cursor.
            objRS.LockType = 2                      'Pessimistic Lock.
            objRS.Source = "Select * from myRange1"
            objRS.Open
       %>
       <br>
       <%
          Response.Write("Original Data")
    
          'Printing out original spreadsheet headings and values.
    
          'Note that the first recordset does not have a "value" property
          'just a "name" property.  This will spit out the column headings.
    
          Response.Write("<TABLE><TR>")
          For X = 0 To objRS.Fields.Count - 1
             Response.Write("<TD>" & objRS.Fields.Item(X).Name & "</TD>")
          Next
          Response.Write("</TR>")
          objRS.MoveFirst
    
          While Not objRS.EOF
             Response.Write("<TR>")
             For X = 0 To objRS.Fields.Count - 1
                Response.write("<TD>" & objRS.Fields.Item(X).Value)
             Next
             objRS.MoveNext
             Response.Write("</TR>")
          Wend
          Response.Write("</TABLE>")
    
          'The update is made here
    
          objRS.MoveFirst
          objRS.Fields(0).Value = "change"
          objRS.Fields(1).Value = "look"
          objRS.Fields(2).Value = "30"
          objRS.Update
    
          'Printing out spreadsheet headings and values after update.
    
          Response.Write("<br>Data after the update")
          Response.Write("<TABLE><TR>")
          For X = 0 To objRS.Fields.Count - 1
             Response.Write("<TD>" & objRS.Fields.Item(X).Name & "</TD>")
          Next
          Response.Write("</TR>")
          objRS.MoveFirst
    
          While Not objRS.EOF
             Response.Write("<TR>")
             For X = 0 To objRS.Fields.Count - 1
                Response.write("<TD>" & objRS.Fields.Item(X).Value)
             Next
             objRS.MoveNext
             Response.Write("</TR>")
          Wend
          Response.Write("</TABLE>")
    
          'ADO Object clean up.
    
          objRS.Close
          Set objRS = Nothing
    
          objConn.Close
          Set objConn = Nothing
       %>
       <!-- End ASP Source Code -->
    					
  2. ??? ??? "???? ?????? ??????" ?????? ?? ?? ????? ?? ????????. ?????? ??????:
          Original Data:
    
          column1    column2    column3
          -----------------------------
    
          rr         this       30
          bb         test       20
          tt         works      25
    
    
          Data after the update:
    
          column1    column2    column3
          -----------------------------
    
          change     look       30
          bb         test       20
          tt         works      25
    					
?????? ?? ????? ????? ??? ???? ????? ?? ???? ???? (??? ????????).

?????

?????? ??? ??????? ??????? ???? ??? ??? ??????? ?????? ?????? ?? "????? ??????? ?? Microsoft:
190195????? ExtractInformation ?? ???? Excel ?? DAO

???????

???? ???????: 195951 - ????? ??? ??????: 13/????? ??????/1425 - ??????: 5.2
????? ???
  • Microsoft ActiveX Data Objects 1.0
  • Microsoft ActiveX Data Objects 1.5
  • Microsoft ActiveX Data Objects 2.0
  • Microsoft ActiveX Data Objects 2.1 Service Pack 2
  • Microsoft ActiveX Data Objects 2.5
  • Microsoft Active Server Pages 4.0
  • Microsoft Data Access Components 2.5
????? ??????: 
kbmt kbcode kbhowto kbmdacnosweep KB195951 KbMtar
????? ????
???: ??? ????? ??? ?????? ???????? ?????? ????? ???? ????? ?????????? ????? ?? ????????? ?????? ????. ???? ???? ?????????? ???? ?? ???????? ???????? ?????? ????????? ????? ????????? ???????? ????? ???????? ?????? ?? ?????? ??? ?? ???????? ???????? ?? ????? ??????? ?????? ??? ??????? ?????? ??. ?????? ?? ???? ??? ??????? ???????? ????? ?? ???? ????? ?????? ??? ????? ??? ????? ??????? ?? ????? ?? ?????? ??? ??? ??????? ??????? ?? ????? ????? ????? ????? ?????. ?? ????? ???? ?????????? ??????? ??? ????? ?? ??????? ?? ????? ?????? ?? ??? ????? ?? ????? ??????? ?? ???????? ?? ??? ???????. ???? ???? ?????????? ???????? ??? ????? ?????? ??????? ??????
???? ??? ????? ??????? ?????? ??????????195951

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

 

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