https://www.microsoft.com/ko-kr/download/details.aspx?id=54920에서 드라이버 다운로드.
32비트는 그냥 설치하면 되지만, 64비트는 cmd 에서 accessdatabaseengine_X64.exe /passive 으로 설치해야 함.
<%
Dim dextUp
Set dextUp = SERVER.CREATEOBJECT("dext.fileupload")
dextUp.DefaultPath = Server.Mappath("./") & "\temp"
Dim attachExcel, dmFileName
attachExcel = dextUp("attachExcel").Save( ,False) '업로드한 엑셀파일
Set dextUp = Nothing
Dim excelCon
Dim conString
Set excelCon = Server.CreateObject("ADODB.Connection")
conString = "Provider=Microsoft.ACE.OLEDB.12.0; Data Source=" & attachExcel & "; Extended Properties='Excel 12.0;HDR=YES;IMEX=1'"
excelCon.Open conString
Dim adox, SheetName
Set adox = CreateObject("adox.catalog")
adox.ActiveConnection = conString
SheetName = adox.Tables(0).Name
Set adox = Nothing
Dim userID, userName, userTel
Sql = "SELECT 아이디, 이름, 전화 FROM [" & SheetName & "] "
Set adoRecord = Server.CreateObject("adodb.recordset")
adoRecord.Open Sql, excelCon, 1
Do Until adoRecord.EOF
userID = adoRecord.Fields(0)
userName = adoRecord.Fields(1)
userTel = adoRecord.Fields(2)
Response.Write "아이디:" & userID & " / "
Response.Write "이름:" & userName & " / "
Response.Write "전화:" & userTel & " / "
Response.Write "<br>"
adoRecord.MoveNext
Loop
adoRecord.Close
Set adoRecord = Nothing
excelCon.Close
Set excelCon = Nothing
%>
'classic asp' 카테고리의 다른 글
[classic asp] identity 테이블 데이터 입력후 일련번호 받기 (0) | 2023.12.28 |
---|---|
[classic asp] json 생성 (0) | 2023.03.01 |
[classic asp] 리스트 데이터 정렬 (0) | 2022.09.06 |
[classic asp] 숫자를 한글로 변환 (0) | 2021.12.03 |
[classic asp] IE 브라우저 확인 (0) | 2021.11.29 |