@@@@@急问一个函数调用的问题????
我在VB里写了一个递归函数想在asp里面调用来生成树型菜单
Public Function getCol(ByVal id As String)
Dim sql As String
Dim i, j As Integer
Dim col As New Collection
'MsgBox ("ok")
sql = "select * from zhcx_zlgl_aqzd where Col1= '" & id & "'"
Set rs = con.Execute(sql)
While Not rs.EOF
' MsgBox rs!SGUID--------------在这里把取到的值传到js脚本里去
col.Add (rs!SGUID)
rs.MoveNext
Wend
While (i < col.Count)
getCol (col.Item(i + 1))
i = i + 1
Wend
End Function
---------------------------------------
生成树型大概象下面的样子
<script language="JavaScript">
var tv=new TreeView();
<%
.....
ResultSet rs=stmt.executeQuery(sql);
while(rs.next()){
%>
tv.add("<%=rs.getInt("id_parentid")%>","<%=rs.getInt("ID")%>","<%= rs.getString("id_name")%>","")
<%
。。。。。。
可是VB里的代码放到asp里面抱错,我该怎么写才能让这个函数在asp里正确运行呢??
大家帮帮忙啊
问题点数:100、回复次数:6Top
1 楼tomtown530(梦想一定会实现!)回复于 2004-12-03 20:20:20 得分 10
报得什么错??
While Not rs.EOF
' MsgBox rs!SGUID--------------在这里把取到的值传到js脚本里去
col.Add (rs!SGUID)
rs.MoveNext
loop
试试
Top
2 楼boytomato(深爱一人叫颖的女孩!)回复于 2004-12-03 20:20:41 得分 10
http://www.destroydrop.com/javascripts/tree/
这中有是用js 写的树,,,
别外好象ms 有个树控件的。
IE Web Controls
自已在网上找找。。。。Top
3 楼javapopo(☆★纸风筝★☆)回复于 2004-12-03 20:24:30 得分 0
Microsoft VBScript 编译器错误 错误 '800a03ee'
缺少 ')'
/my/gettree.asp,行6
Public sub getCol(ByVal id As String)
----------------------------------------------
我是这样调用的
<!--#include file="conn.asp"-->
<!--#include file="gettree.asp"-->
<%
call getCol(1)
%>Top
4 楼javapopo(☆★纸风筝★☆)回复于 2004-12-03 20:26:50 得分 0
Microsoft VBScript 编译器错误 错误 '800a03ee'
缺少 ')'
/my/gettree.asp,行6
Public Function getCol(ByVal id As String)
这样也不行??????
Top
5 楼webdiyer(.net资源精华—www.dotneturls.com)回复于 2004-12-03 20:29:05 得分 10
楼主问的是asp的问题,我帮你转到asp组去,asp和asp.net已经差不多是两种完全不同的技术了。Top
6 楼dsclub(任搏软)回复于 2004-12-03 20:46:56 得分 70
AS 类型不要写
Public也不写Top




