<% '******************************** '* HTTP NewsGroups '* (c) ML Computersysteme 1998 '* http://www.mlsys.de '* %> HTTP-News

HTTP-Newsgroups

<% set DataConn=server.createobject("adodb.connection") cnpath="DBQ=" & server.mappath("/news/db/news.mdb") DataConn.Open "DRIVER={Microsoft Access Driver (*.mdb)};" & cnpath set tb = Server.CreateObject("ADODB.Recordset") tb.Open "Select * from [Gruppen] WHERE [Zeiger] = Null or [Zeiger] = 0 order by [Gruppe]", DataConn Do While not tb.EOF Response.Write "" & tb.Fields("Gruppe") & " (" & CountArticle(tb.Fields("Nummer")) & ")
" & vbcrlf WriteGruppen tb.fields("Nummer"), 1 tb.movenext Loop tb.close DataConn.close Set tb = Nothing Set DataConn = Nothing Sub WriteGruppen(Zeiger, Level) set gb = Server.CreateObject("ADODB.Recordset") gb.Open "Select * from [Gruppen] WHERE [Zeiger] = " & Zeiger & " order by [Gruppe]", DataConn Do While not gb.EOF Response.Write "" & "" & gb.Fields("Gruppe") & " (" & CountArticle(gb.Fields("Nummer")) & ")
" & vbcrlf WriteGruppen gb.fields("Nummer"), Level + 1 gb.movenext Loop gb.close Set gb = Nothing End Sub Function CountArticle(Gruppe) set rs = DataConn.execute("SELECT COUNT(*) As RsCount FROM [Artikel] WHERE [Gruppe] = " & Gruppe & " GROUP BY [Gruppe]") if not (rs.eof and rs.bof) then CountArticle = rs("RsCount") else CountArticle = 0 end if rs.Close set rs = nothing End Function %>

ML-Computersysteme 1998