我在页面里有一个 下拉式选单 ,里面的内容由 数据库查找所得通过一个 二维数组 追加进去的.
我要将 下拉式选单 内的容为条件 追加数据库的内容, 追加一个下拉式选单的内容减少一个
当我全都减没时,二维数组为空 要根据是否为空 做下面的操作.
请指教
<td width="20%">
<select name="MenuShikaku" size="1">
<%
If ********* Then
Response.Write "<option value=""></option>"
Else
For i=0 To UBound(asTuikashikakuInfo,2)
If sShikakuCod = asTuikashikakuInfo(0,i) Then
Response.Write "<option value=" & asTuikashikakuInfo(0,i) & "selected>" & asTuikashikakuInfo(1,i) & "</option>"
Else
Response.Write "<option value=" & asTuikashikakuInfo(0,i) & ">" & asTuikashikakuInfo(1,i) & "</option>"
End if
Next
End If
%>
</select>
********* 处的条件语句请指教
SQL语句在下面
fnbCom_J_GetTuikashikaku = False
Dim sSQL, i
sSQL = ""
sSQL = sSQL & "SELECT "
sSQL = sSQL & "TANKA.SHIKAKU_COD, "
sSQL = sSQL & "TANKA.GRADE "
sSQL = sSQL & "FROM DKS.dbo.DKS_M_SHIKAKU_BETU_TANKA as TANKA "
Dim rst
If fnbComOpenRecordset(sSQL, con, rst) = False Then
Call sbComCloseConnection(con)
Call Err.Raise(vbObjectError + 10000)
Exit Function
End If
If rst.EOF = True Then
Call sbComCloseRecordset(rst)
Exit Function
Else
i=0
Do Until rst.EOF
ReDim Preserve asTuikashikakuInfo(1,i)
asTuikashikakuInfo(0,i) = rst.Fields("SHIKAKU_COD").Value
asTuikashikakuInfo(1,i) = rst.Fields("GRADE").Value
rst.MoveNext
i = i + 1
Loop
End if
Call sbComCloseRecordset(rst)
fnbCom_J_GetTuikashikaku = True
End Function
好把能提供的东西,都拿上来了,有点多,嘿嘿 麻烦大家了