1.添加odbc數據源

2.添加dsn

3.配置dsn

4.測試連接
tns為服務名

5.添加數據庫連接配置
<%
set conn=server.createobject("adodb.connection")
conn.ConnectionTimeout = 1000
conn.CommandTimeout = 2000
conn.Open "DSN=myweb;UID=lin;PWD=lin123;"
%>
6.代碼連接
<!-- #include file="./lib/conn.inc"-->
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=big5">
<title>Demo</title>
</head>
<body>
<table>
<tr>
<td>頁面測試</td>
<td>
<select name="user_name" id="user_name" value="">
<%
sql=" select * from MY_CSV "
set rs = conn.execute(sql)
if not rs.eof then
do while not rs.eof
%>
<option value="<%=rs("A")%>"><%=rs("A")%></option>
<%
rs.movenext
loop
end if
%>
</select>
</td>
</tr>
</table>
</body>
</html>

版权声明:本文为weixin_73368873原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。