asp调用DLL文件问题
本人刚刚接触asp调用DLL文件,有一个小问题请高手指点:测试的DLL文件:工程名:aaaa 类名:bbbbPublic Function topList(bumeng As String)Sql_top = "select * from menu where bumeng= '" & bumeng & "' and dhang='首页'"Set rs_top = conn.execute(Sql_top)If Not rs_top.EOF ThenDo While Not rs_top.EOFresponse.write ("<td align=center class='shadow2'>")If Trim(rs_top("disp")) = "" Then '如果属性为空则自动加入系统连接response.write ("<a href='dj_index_listmore.asp?id=" & rs_top("id") & "&vtype=" & Mid(rs_top("menuname"), 6) & "&vpartname=" & bumeng & "'>" & Mid(rs_top("menuname"), 6) & "</a></td>")Else '否则自定义连接response.write ("<a href=" & rs_top("disp") & ">" & Mid(rs_top("menuname"), 6) & "</a></td>")End Ifrs_top.movenextLoopEnd IfSet rs_top = NothingEnd FunctionASP调用的页面:<%Set ccc= Server.CreateObject("aaaa.bbbb")ccc.toplist%>报错信息为:Microsoft VBScript 运行时错误 (0x800A01C1)参数是必选项: 'toplist'请高手指点。。。。。谢谢。
参考答案:声明为Public Function topList(Optional bumeng As String) ,否则你调用TopList时必须给定bumeng参数。