网络编程
位置:首页>> 网络编程>> Asp编程>> 如何利用数据库内容建立一个下拉式列表?

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

 来源:asp之家 发布时间:2010-01-01 15:46:00 

标签:下拉列表,数据库,asp

代码如下:

<% 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
' 清空对象
%>

0
投稿

猜你喜欢

手机版 网络编程 asp之家 www.aspxhome.com