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

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

?? ????? ??

??????

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

??????????: ASP/ADO ????????? ???-?????????? ????? ?? ??????, ?????? ???? Excel ?????????? ???? ????? ?????, ?? ???? ?? ?????? ?? ??????? ?????? ???? ?? ?????? ???? ???? ???????? ???-?????????? ??????

???? ???????

?? ????? ?? ??? ???? Excel ?????????? ??? ???? ?? ????? ??, Excel ?? ??? Microsoft ODBC ??????? ?? ????? ????? ??? Named ?????? ?? ???? Excel ?????????? ??? ??? ?? ???? ?? ??????? ?? ??? ?? ?????? ??????

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

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

    ?? ?????? ?? ??????? ?????? ?????? ?? ??????? ????
    column1column2column3
    rr??15
    bbTest20
    ee??? ???? ??25

    ???:?? ??? ???? Excel ?????????? ??? ???? ????? ??? ??? ?? ????????, Excel ODBC ??????? ???? ??? ????? ?? ???????? ???-?? ???? ?????? ?? ????? ???? ?????? ????? ????????? ???? ?? ???? ????? ??? ??? ?????? ?? ???? ???? ?????? ???? ????? ??? ????????? ?? ???? ?? ??? ??? ????? ??? ???????? ???? ???? ?????? ?? ???? ?? ?? ???? "???????" ?? "???" ?? ??? ????-???? ??????:
    1. Microsoft OLE DB ??????? ODBC ??????? ?????? '80040e21' ?? ???
      ?????? ??? ?? ODBC ??????? ?????? ??????? ???? ?? ?? ?? ???? ????
    2. Microsoft OLE DB ??????? ODBC ??????? ?????? ?? ??? '80004005'
      ?????? updateable ???? ?? ??????? ????? ??? hopeful ????? ?? ??? ??? ????? ???? ?? ??? searchable ????? ???? ???
    3. Microsoft OLE DB ??????? ODBC ??????? ?????? ?? ??? '80004005'
      ?????? ?????? ?????? ???? ???? ?????? ?? ?????? ???? ?? ??? ?????? ???? ?? ????
  • ??? Named ??????, myRange1, ?? ???? ?????????? ??? ?????:

    1. Row(s) ?? column(s) ??????? ??? ???? ????? ???? ???? ?? ??????? ?????
    2. ' ???????? ???? ' ???? ?? ??? ?? ????? ????, ?? ????????? ???? ?? ????? ?????
    3. ??? myRange1 ?? Named ?????? ?? ??? ???? ????
    4. ??? ????? ?????
    Named ?????? myRange1 ????? ???? ??? ??:

    ?? ?????? ?? ??????? ?????? ?????? ?? ??????? ????
    column1column2column3
    rr??15
    bbTest20
    ee??? ???? ??25


    ???:ADO ????? ?? ?? Excel ?? ???? ?????? ??? ????? ?????? ??? ????? ????? ???? ?????, Named ?????? ????? ????? ????? ???? ?????? ?? DAO ?? ????? ??????? ???

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

??? ?? ???? ?????? ????? ????? ?? ??? ????? authenticating ???, ?? ????????? ???? ?? ???? ????????? ?? ??????? ??? ??? ???????????? ?? ??? ???? ????????? ???? ?? ??? ?????? ???

???:??? ?? ???? ?????????? ?? ???? ????????? ??? ????, ?? ???? ??????? ?? ?????? ????? ????? ?? ???? ???? ??:

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

[Microsoft][ODBC Excel ???????] 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
    					
???:??? ?????? (??? ?????) ???? Named ?????? ?? ???? ?????? ?? ?? ?? ???

??????

???????? ??????? ?? ???, Microsoft ?????? ??? ??? ???? ????? ?? ??? ????? ???? ?????? ????? ????::
190195???? ExtractInformation DAO ?? ??? Excel ????? ?? ????

???

???? ID: 195951 - ????? ???????: 02 ?????? 2010 - ??????: 3.0
???? ???? ???? ??:
  • Microsoft Active Server Pages 4.0
  • Microsoft Data Access Components 2.5
??????: 
kbcode kbhowto kbmdacnosweep kbmt KB195951 KbMthi
???? ?????? ????????
??????????: ?? ???? ?? ???? ??????? ?? ????? ?? Microsoft ????-?????? ?????????? ?????? ?????? ???? ??? ??. Microsoft ???? ??? ????-???????? ?? ????-???????? ????? ?????? ?? ???? ???????? ???? ?? ???? ????? ????? ??? ?? ??? ?????? ?? ???? ???? ???? ??? ????? ??. ???????, ????-???????? ???? ????? ???? ???? ???? ???. ?????, ????????, ?????-???? ?? ??????? ?? ???????? ?? ???? ???, ???? ?? ??? ?????? ???? ???? ??? ????? ??? ?? ???? ??. Microsoft ??????? ??? ???? ?? ?????? ?? ??????????, ????????? ?? ??? ?????? ?? ???? ????? ?? ???? ???????? ?? ??? ???? ????? ?? ??? ????????? ???? ??. Microsoft ????-?????? ?????????? ?? ????? ?????? ?? ?? ??? ??.
?????????? ?? ??????? ????????? ??????? ??: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