C:\inetpub\
wwwroot\demo 경로 txt파일
read1.asp
<html>
<head>
<title>Contents</title>
</head>
<body bgcolor="#FFFFFF">
<p><big><big>Categories</big></big> </p>
<hr size="1" align="left">
<%
Set Conn = Server.CreateObject("ADODB.Connection") //연결
Conn.ConnectionString = "DSN=win.dsn" //DSN 설정한곳으로 간다.
Conn.Open //데이터베이스 열기
Set Rs = Server.CreateObject("ADODB.Recordset")
Rs.Open "Select * From tblCategories", Conn //카테고리 찾기
%>
<table border="1" width="670">
<tr bgcolor="gray">
<td width="155" height="11">
<p><b>Category ID</b></p>
</td>
<td width="159" height="11">
<p><b>Category Name</b></p>
</td>
<td width="334" height="11">
<p><b>Description</b></p>
</td>
</tr>
<%
while not Rs.eof //레코드선이 마지막줄이 아니라면 반복하는 코드
%>
<tr>
<td width="155" height="3">
<p><%=Rs("CategoryID")%></p>
</td>
<td width="159" height="3">
<p><%=Rs("CategoryName")%></p>
</td>
<td width="334" height="3">
<p><%=Rs("Description")%></p>
</td>
</tr>
<%
Rs.movenext
Wend
Rs.close
set Rs=nothing
Conn.close
Set Conn=nothing
%>
</table>
<p align="left"><strong>SQL:</strong> <font face="Times New Roman" size="3" color="#000000">Select *
From
tablename</font></p>
<p align="left"><a href="main.asp">Main</a></p>
</body>
</html>