我是新手,谁能告诉我怎么才能使登录下拉框中的内容和数据库中的内容联系起来?

limengtao 2003-05-15 09:42:44
我想实现登录窗口中的用户名框是一个下拉框,其中显示的内容是我的数据库中的能容,当我的数据库中的内容有所改变时,它也跟着变。有人可以指点我吗?
...全文
105 4 打赏 收藏 举报
写回复
用AI写文章
4 条回复
切换为时间正序
请发表友善的回复…
发表回复
roy66 2003-05-15
  • 打赏
  • 举报
回复
<select name=name>
<%
set rs=server.CreateObject("Adodb.recordset")
rs.open "select name from table"
do while not rs.eof
response.write "<option>"
response.write rs(0)
rs.movenext
loop
%>
</select>
cqfeng 2003-05-15
  • 打赏
  • 举报
回复
<select name="yonghuming">
<option value="">
<% sql="select yonghuming from guanliyuan "
set rs=Server.CreateObject("adodb.recordset")
rs.open sql,conn,1,1
do while not rs.eof %>
<option value="<%= rs("yonghuming") %>"><%= rs("yonghuming") %>
<% rs.movenext
loop
rs.close
set rs=nothing %>
</select>
limengtao 2003-05-15
  • 打赏
  • 举报
回复
我试了一下行不通啊!能告诉我把这段程序插在哪儿吗?毕业设计很急,能帮帮我吗?
<table border="0" width="100%" bgcolor="#ECFFEC" style="font-size: 9pt; border: 1 solid #0000FF">
<tr>
<td width="100%" style="font-size: 9pt"> </td>
</tr>
<tr>
<td width="100%"> 科研项目管理系统入口</td>
</tr>
<tr>
<td width="100%" align="center">用户名:<select size="1" name="yonghuming" style="font-size: 9pt">

<option>计算机学院</option>
<option>石油工程学院</option>
<option>石油化工学院</option>
 

</select></td>
</tr>
<tr>
<td width="100%" align="center">口  令:<input type="text" name="T1" size="14" style="font-size: 9pt"></td>
</tr>
<tr>
<td width="100%" align="center" height="1" style="font-size: 10px">  <input type="submit" value="确认" name="B1" style="font-size: 9pt">    
<input type="reset" value="取消" name="B2" style="font-size: 9pt"></td>
</tr>
</table>
是不是还应该加一对<form>啊
limengtao 2003-05-15
  • 打赏
  • 举报
回复
谢谢!我的毕业设计还有好多没做呢!以后又问题还请多多指教。先行谢过!!

28,402

社区成员

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

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