zachary
Starting Member
29 Posts |
Posted - December 27 2012 : 01:45:58
|
Hi Aprilynm,
I got a script sample here, hope it helps:
You just need to put the script below in a ".asp" page & upload to your VPASP Root then you are able to test it.
<%option explicit%> <%response.buffer=true%> <!--#include file="shop$db.asp"--> <%ShopOpenDatabase dbc%> <% displayproduct sub displayproduct dim sql,rs,selected sql="select * from products where hassubproduct='Yes'" Set rs = Server.CreateObject("ADODB.Recordset") rs.open sql, dbc, adOpenForwardOnly, adLockReadOnly if not rs.eof then do while not rs.eof debugwrite "<b>"&rs("cname") &" - "& rs("ccode") &"</b>" getchildproduct rs("catalogid") rs.movenext loop end if end sub
Sub getchildproduct(parentid) dim sql2,rs2,selected sql2="select * from products where highercatalogid = "&parentid Set rs2 = Server.CreateObject("ADODB.Recordset") rs2.open sql2, dbc, adOpenForwardOnly, adLockReadOnly if not rs2.eof then do while not rs2.eof debugwrite " - " & rs2("cname") &" - "& rs2("ccode") rs2.movenext loop end if end sub %>
<%ShopCloseDatabase dbc%>
Thanks Zach |
|
|