ClassicASP 서버에 업로드된 엑셀(xls 또는 xlsx) 내용을 웹페이지로 보이기
페이지 정보
본문
Microsoft Jet OLE DB 4.0 Provider에서 ADO(ActiveX Data Objects)를 사용하여 Microsoft Excel 통합 문서에서 데이터를 읽고 쓰는 방법을 보여 줍니다.
<%
Set xlDb = Server.CreateObject("ADODB.Connection")
if fileType = "xlsx" then
connectString = "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=" + inFileName + "; Extended Properties=Excel 12.0;"
else
connectString = "Provider=Microsoft.Jet.OLEDB.4.0; Data Source=" & UpExcelFile & "; Extended Properties=Excel 8.0;"
end if
'EXCEL Connect
xlDb.Open connectString
' xlsx 열기
' ObjXls.Open "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=" + inFileName + "; Extended Properties=Excel 12.0;"
' xls 열기
' ObjXls.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + inFileName + "; Extended Properties=Excel 8.0;"
' sheel 목록 가져오기
Set oADOX = CreateObject("ADOX.Catalog")
oADOX.ActiveConnection = connectString
For Each oTable in oADOX.Tables
Response.Write oTable.Name & "<br>"
Next
%>
관련자료
http://support.microsoft.com/kb/278973/ko
http://blog.naver.com/PostView.nhn?blogId=garnete&logNo=110052487294
<%
Set xlDb = Server.CreateObject("ADODB.Connection")
if fileType = "xlsx" then
connectString = "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=" + inFileName + "; Extended Properties=Excel 12.0;"
else
connectString = "Provider=Microsoft.Jet.OLEDB.4.0; Data Source=" & UpExcelFile & "; Extended Properties=Excel 8.0;"
end if
'EXCEL Connect
xlDb.Open connectString
' xlsx 열기
' ObjXls.Open "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=" + inFileName + "; Extended Properties=Excel 12.0;"
' xls 열기
' ObjXls.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + inFileName + "; Extended Properties=Excel 8.0;"
' sheel 목록 가져오기
Set oADOX = CreateObject("ADOX.Catalog")
oADOX.ActiveConnection = connectString
For Each oTable in oADOX.Tables
Response.Write oTable.Name & "<br>"
Next
%>
관련자료
http://blog.naver.com/PostView.nhn?blogId=garnete&logNo=110052487294
댓글목록
등록된 댓글이 없습니다.