用asp和数据库,给用户的选项来改变下拉文本的内容

hsdly 2003-08-19 03:10:01
用asp和数据库,给用户的选项来改变下拉文本的内容
...全文
97 7 打赏 收藏 转发到动态 举报
写回复
用AI写文章
7 条回复
切换为时间正序
请发表友善的回复…
发表回复
hsdly 2003-08-20
  • 打赏
  • 举报
回复
我的意思是根据用户的选定某一项以后,更新下拉文本的内容!
hsdly 2003-08-19
  • 打赏
  • 举报
回复
why?
hsdly 2003-08-19
  • 打赏
  • 举报
回复
我是这么些的怎么,页面上没有任何反应!
Nakata6 2003-08-19
  • 打赏
  • 举报
回复
<select name="mydepart" size="1" id="mydepart">
<option value="请选择" selected>请选择</option>
<%
sql1="select * from tdepart"
set rs1=Server.CreateObject("adodb.recordset")
rs1.open sql1,conn,1
while not rs1.eof and not rs1.bof
%>
<option value="<%=rs1("id")%>"><%=rs1("ftype")%></option>

<%
rs1.movenext
wend
%>
</select>
reidli 2003-08-19
  • 打赏
  • 举报
回复
……(连接数据库略去)
<%
set rs=server.createobject("adodb.recordset")
sql="select * from table"
rs.open sql,conn,2,3
%>

<select>
<%
do until rs.eof
<option value="<%=rs("字段名一")%>"><%=rs("字段名一")%></option>
rs.movenext
loop
%>
</select>
pp4u 2003-08-19
  • 打赏
  • 举报
回复
rs.close
set rs=nothing
conn.close
set conn=nothing
pp4u 2003-08-19
  • 打赏
  • 举报
回复
dim conn
set conn=server.createobject("adodb.connection")
conn.connectionstring="Driver={SQL Server};server=" & trim(serip) & ";uid=sa;pwd=;database=manager"
conn.open
dim res
set res=server.createobject("adodb.recordset")
res.open "table",conn,1,3
<select name="select4" size="10" height="100" width="100" style='width:100'>
<%

while not res.eof
response.write("<option value='" & res("ID") & "'>" & res("Name") & "</option>")
res.movenext
wend
%>
</select>

28,390

社区成员

发帖
与我相关
我的任务
社区描述
ASP即Active Server Pages,是Microsoft公司开发的服务器端脚本环境。
社区管理员
  • ASP
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧