Hva gjør jeg feil i denne koden?
Jeg skal ha den til å liste ut:Kategori
- subkategori
etc etc..........
<%
dim strConn
strConn = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & Server.MapPath("database/Document.mdb")
dim strConnImg
strConnImg = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & Server.MapPath("database/ImageLibrary.mdb")
dim adoCn
dim strSQL
set adoCn = Server.CreateObject("ADODB.Connection")
adoCn.Open strConn
'Deklarerer variabler
dim adoRs, adoRS1
'Rekordset for Categori.
set adoRs = Server.CreateObject("ADODB.Recordset")
'Rekordset for Subkategori.
set adoRs1 = Server.CreateObject("ADODB.Recordset")
'Henter Categoriene.
strSQL = "Select Categori, DocumentID From Documents"
'Henter Subkategoriene.
strSQL1 = "Select Title, DocumentID From Documents"
'Henter kategoriene.
set adoRs = adoCn.Execute(strSQL)
%>
<html>
<body>
<%
Do While Not adoRs.EOF%>
<li><%=adoRs("Categori")%></li>
<%
set adoRs1 = adoCn.Execute(strSQL1)
Do While Not adoRs1.EOF%>
<ul><a href="user_DocView.asp?DocumentID=<%=adoRs1("DocumentID")%>"><%=adoRs1("Title")%></a></ul>
<%
'Looper gjennom subkategoriene.
adoRs1.MoveNext
Loop
adoRS1.Close
adoRS.MoveNext
Loop
adoRs.Close
set adoRs = nothing
adoCn.Close
set adoCn = nothing
%>
</body>
</html>