如何利用数据库内容建立一个下拉式列表?

网络编程 发布日期:2024/10/8 浏览次数:1

正在浏览:如何利用数据库内容建立一个下拉式列表?

如何利用数据库内容建立一个下拉式列表?

<% myDSN="DSN=xur;uid=xur;pwd=xur"
mySQL="select * from authors where AU_ID<100"
set conntemp=server.createobject("adodb.connection")
conntemp.open myDSN
set rstemp=conntemp.execute(mySQL)
if rstemp.eof then
response.write "噢,数据库为空!"
response.write mySQL
conntemp.close
set conntemp=nothing
response.end
 end if%>
<%do until rstemp.eof %>
<%
rstemp.movenext
loop
rstemp.close
set rstemp=nothing
conntemp.close
set conntemp=nothing

' 清空对象
%>