?? ???? ????????? ???? ?? ?? ?????? ?? ?? ?????? ????? ????? (ASP) ??? ?? ActiveX ???? ???????? (ADO) ?? ????? ?? Excel ?????????? ??? ??????? ?????? ???? ?? ??? ???? ????? ???? ?? ????????? ?? ?????? ?? ?????? ?????? ?? ?? ????? ???? ???
??????????: ASP/ADO ????????? ???-?????????? ????? ?? ??????, ?????? ???? Excel ?????????? ???? ?????
?????, ?? ???? ?? ?????? ?? ??????? ?????? ???? ?? ?????? ???? ???? ???????? ???-?????????? ??????
?? ????? ?? ??? ???? Excel ?????????? ??? ???? ?? ????? ??, Excel ?? ??? Microsoft ODBC ??????? ?? ????? ????? ??? Named ?????? ?? ???? Excel ?????????? ??? ??? ?? ???? ?? ??????? ?? ??? ?? ?????? ??????
????? ????????? ????? ?? ??? ???
- Excel ????? ADOtest.xls sheet1 ??? ????? ???? ??? ?????:
?? ?????? ?? ??????? ?????? ?????? ?? ??????? ????
| column1 | column2 | column3 |
|---|
| rr | ?? | 15 |
| bb | Test | 20 |
| ee | ??? ???? ?? | 25 |
???:?? ??? ???? Excel ?????????? ??? ???? ????? ??? ??? ?? ????????, Excel ODBC ??????? ???? ??? ????? ?? ???????? ???-?? ???? ?????? ?? ????? ???? ?????? ????? ????????? ???? ?? ???? ????? ??? ??? ?????? ?? ???? ???? ?????? ???? ????? ??? ????????? ?? ???? ?? ??? ??? ????? ??? ???????? ???? ???? ?????? ?? ???? ?? ?? ???? "???????" ?? "???" ?? ??? ????-???? ??????:- Microsoft OLE DB ??????? ODBC ??????? ?????? '80040e21' ?? ???
?????? ??? ?? ODBC ??????? ?????? ??????? ???? ?? ?? ?? ???? ????
- Microsoft OLE DB ??????? ODBC ??????? ?????? ?? ??? '80004005'
?????? updateable ???? ?? ??????? ????? ??? hopeful ????? ?? ??? ??? ????? ???? ?? ??? searchable ????? ???? ???
- Microsoft OLE DB ??????? ODBC ??????? ?????? ?? ??? '80004005'
?????? ?????? ?????? ???? ???? ?????? ?? ?????? ???? ?? ??? ?????? ???? ?? ????
- ??? Named ??????, myRange1, ?? ???? ?????????? ??? ?????:
- Row(s) ?? column(s) ??????? ??? ???? ????? ???? ???? ?? ??????? ?????
- ' ???????? ???? ' ???? ?? ??? ?? ????? ????, ?? ????????? ???? ?? ????? ?????
- ??? myRange1 ?? Named ?????? ?? ??? ???? ????
- ??? ????? ?????
Named ?????? myRange1 ????? ???? ??? ??:
?? ?????? ?? ??????? ?????? ?????? ?? ??????? ????
| column1 | column2 | column3 |
|---|
| rr | ?? | 15 |
| bb | Test | 20 |
| ee | ??? ???? ?? | 25 |
???:ADO ????? ?? ?? Excel ?? ???? ?????? ??? ????? ?????? ??? ????? ????? ???? ?????, Named ?????? ????? ????? ????? ???? ??????
?? DAO ?? ????? ??????? ???
???:????? ????? ?? ??? ?????? ???? ???? ?? ???? ??? Excel ??????? ?????? ?? ???????? ???? ?? ????, ?? ???? ????, ?? ???? ?? ?????? ???? ??? ?????? ?? ???, ???? ????? ????? ?? "F1" ?? ???? ???? ?? ???? misinterpreted. - ??? ODBC ?????? ???? ????? ?? ??? (DSN) ????? ???? ?? ??? ADOTest.xls ????? ??????
- ???????? ???? ?? ??? ODBC ???????????
- ?????? DSN ??? ??, ?????? ????? ?????
- Microsoft Excel ??????? (*.xls) ?? ??? ????, ?? ?????? ???? ????? ?????
??? ?? ?????? ????? ???? ??, ?? Excel ????? ?? Excel ?? ??? Microsoft ODBC ??????? ?? ??????? ???? ?? ??? ?????? ???
- ???? ????? ?? ??? ?? ??? ADOExcel ' ??????
- ?? ????????? ???? ?? ??????? Excel ?? ??? ??????? ?? ??? ??? ???
- "?? ??? ????.. ?????????????." ????? ????, ADOTest.xls ???? ?? ??? ??????? ????, ????? ?? ??? ????? ?????
- ????? ???? "?????? >>" ??? ?? "???? ???? ?? ???" ??? ????? ????? ?????
- ??? ????? ????, ?? ?? ???: ??? ????? ?????
- ADOTest.xls ????? ?? ????????? ?? ??? ?????
??? ???? ?????? ????? ????? ???? ??? ?? ?? ?? ?????? ??, ???? ????????? ???? ?? ???? ???? (IUSR_ <machinename>) ??? ?? ?? ?? ???? ?? ??? ????? ?????????? ??? ???/???? (RW)? ?????????? ?? ??????? ????? ????? ???, ??? ?? ????????? ?? ??????? ???? ?????? ??? </machinename>
??? ?? ???? ?????? ????? ????? ?? ??? ????? authenticating ???, ?? ????????? ???? ?? ???? ????????? ?? ??????? ??? ??? ???????????? ?? ??? ???? ????????? ???? ?? ??? ?????? ???
???:??? ?? ???? ?????????? ?? ???? ????????? ??? ????, ?? ???? ??????? ?? ?????? ????? ????? ?? ???? ???? ??:
Microsoft OLE DB ??????? '80004005' ODBC ??????? ?????? ?? ???
[Microsoft][ODBC Excel ???????] Microsoft Jet ??????? ????? '(??????)' ???? ??? ???? ????? ?? ???? ???? ???? ?????????? ?????? ???? ???? ?? ?? ??, ?? ?? ???? ???? ?? ????? ?? ?????? ?? ???????? ???
- 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 -->
- ?????? ?? ???? ?????? ????? ????? ?? ??? ?? ??????? ??? ?????? ?? ????? ???????:
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
(http://support.microsoft.com/kb/190195/
)
???? ExtractInformation DAO ?? ??? Excel ????? ?? ????