Thought of posting the whole code:
<%
Set MyConn=Server.CreateObject("ADODB.Connection")
MyConn.Open "Driver={Microsoft Access Driver (*.mdb)}; DBQ=" & Server.Mappath("../../db/cadranpolitic.mdb")
set rs0 = MyConn.Execute ("Select Cur_Issue From Cur_Issue")
session("cur_issue")=rs0("cur_issue")
set rs1 = MyConn.Execute ("Select Distinct Art_Section From Articles")
if not rs1.EOF then
rs1.movefirst
do
Response.Write("<H2>" & RS1("Art_Section") & "</H2>")
Response.Write("<hr>")
set rs2 = MyConn.Execute ("Select * From Articles Where Art_Section='" & RS1("Art_Section") &"' AND Issue_Nr="& session("cur_issue") & "")
if not rs2.EOF then
rs2.movefirst
do
Response.Write("<H3>" & RS2("Art_Title") & "</H3>" & "</br>")
Response.Write("<i>"&"<b>" & RS2("Art_Author") & "</b>"&"</i>" &"</br>")
Response.Write(" "& RS2("Art_Header") &"" & "<a href=""view_article.asp?item=" & RS2("ID") &"""target=""_blank"">Articol complet...</a>"& "</br>")
Response.Write("<hr>")
rs2.MoveNext
loop until rs2.EOF
end if
response.write "</br>"
rs1.movenext
loop until rs1.EOF
end if
MyConn.Close
set dbConn = Nothing
set rs1 = Nothing
set rs2 = Nothing
%>
Whell there are 2 problems with it: 1 If I try to sort records by issue_nr, it triggers the "to few parameters Error.Expect 1". If comment that, the script works but instead o response.writing the records the way I want - and it should, i guess as I select distinct them. That is, instead of:
Art_Section_1
Art_Section_1_Article_1_Title
Art_Section_1_Article_1_Author
Art_Section_1_Article_1_Header
Art_Section_1_Article_2_Title
Art_Section_1_Article_2_Author
Art_Section_1_Article_2_Header...
Art_Section_2
Art_Section_2_Article_1_Title
Art_Section_2_Article_1_Author
Art_Section_2_Article_1_Header...
It displays them totaly random...