服务端程序:
<%@Language=VBScript%>
<%RSDispatch %>//必需的
<!--@CopyWright&Edit by Wang xuejun April,2001--〉
<!--'please pay attention to the path of the folder _scriptlibrary,it should be included in. -->
<!--#INCLUDE FILE="../../_ScriptLibrary/RS.ASP"-->//同客户端
<SCRIPT RUNAT=SERVER LANGUAGE="JavaScript">
var public_description = new MyServerMethods();
function MyServerMethods()
{
this.add = Function( 'value','return add(value)' );//用java声明指向vbscript 函数
}
</SCRIPT>
<SCRIPT RUNAT=SERVER LANGUAGE="VBScript">
Function add(value)//value是传过来的父亲id
dim second,value1,value2
second=""
//下面是从表中根据得到的父类id 把子类找出来
Set conn = Server.CreateObject("ADODB.Connection")
conn.Open "cxxxx"
Set Rs= Server.CreateObject("ADODB.Recordset")
sqlText="select childid,description from table where fatherid="&value
Rs.open sqlText,conn,1
while not Rs.eof
second=second&Rs("childid")&"/"&Rs("description")&"/"
Rs.movenext
wend
rs.Close
conn.Close
set rs=nothing
set conn=nothing
add=second&"*"//用*表明数组完毕
End Function
</SCRIPT>
'如果目前是第一种颜色,而且水果名称正在改变,就将水果名称写到 fruit 下拉式选单中
if howmanygroups=0 then
If thissubgroupcount=0 then
fruitlist = fruitlist & "<option>" & thisvalue2 & "</option>" & vbcrlf
end if
End If
'如果目前是第一种颜色,而且是第一种水果,就将价格写到 price 下拉式选单。
if howmanygroups=0 then
if howmanysubgroups=0 then
pricelist = pricelist & "<option>" & thisvalue3 & "</option>" & vbcrlf
end if
End if