ASP 怎么将数据库表中取出的赋值给下拉列表/菜单
还下拉的"列表/菜单"的值怎么做呢??我是从数据库中取出的值做成的下拉列表:<%DimstrSql,rsstrSql="selectBRANCH_NAMEfromBRAN...
还下拉的"列表/菜单" 的值怎么做呢??
我是从数据库中取出的值做成的下拉列表:
<%
Dim strSql,rs
strSql="select BRANCH_NAME from BRANCH "
set rs = Server.CreateObject("ADODB.Recordset")
rs.open strSql, my_Conn, adOpenKeyset, adLockOptimistic, adCmdText
if rs.eof and rs.bof then
response.write "No Data"
response.end
end if
response.write strSql
%>
<select name="BranchName" id="BranchName">
<%
do while not rs.eof
response.write "<option>" & rs("BRANCH_NAME") & "</option>" & vbCrLf
rs.movenext
loop
%>
</select>
<%
rs.close
set rs=Nothing
set strSql=Nothing
%> 展开
我是从数据库中取出的值做成的下拉列表:
<%
Dim strSql,rs
strSql="select BRANCH_NAME from BRANCH "
set rs = Server.CreateObject("ADODB.Recordset")
rs.open strSql, my_Conn, adOpenKeyset, adLockOptimistic, adCmdText
if rs.eof and rs.bof then
response.write "No Data"
response.end
end if
response.write strSql
%>
<select name="BranchName" id="BranchName">
<%
do while not rs.eof
response.write "<option>" & rs("BRANCH_NAME") & "</option>" & vbCrLf
rs.movenext
loop
%>
</select>
<%
rs.close
set rs=Nothing
set strSql=Nothing
%> 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询