📄 producttypebase.asp
字号:
<%
'========================================================
'
' 将所有出版商添加到下拉列表框中
' 说明:这里只添加ProductType表中SuperId=0的记录
' 参数:
' nTypeId:当前选种的出版商名称ID
' szCtlName:下拉列表框的名称,在获取表单中的数时用
'========================================================
function TypeToSelect(nTypeId, szCtlName)
dim strSQL
dim rsType
dim tempi
dim nID, szName
Response.Write "<SELECT name =""" & szCtlName & """ ID=""Select1"">"
Response.Write "<option value = ""0"">全部分类</option>"
strSQL = "SELECT * FROM ProductType WHERE SuperID = 0"
set rsType = Server.CreateObject("ADODB.RecordSet")
rsType.Open strSQL, conn, 2,1
if rsType.EOF And rsType.BOF then
'如果没有检索到产品类型
Response.Write "</SELECT>"
rsType.Close()
Set rsType = Nothing
exit function
else
do while not rsType.eof
nID = rsType("id")
szName = rsType("name")
Response.Write "<option value = "& nID
'如果当前的nID与传入的nTypeId相同,则选中它
if CInt(nID) = CInt(nTypeId) then Response.Write " selected"
Response.Write ">"
Response.Write szName &"</option>"
rsType.MoveNext
loop
end if
Response.Write "</SELECT>"
rsType.Close()
Set rsType = Nothing
end function
%>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -