<% Option Explicit %> Questions <% Dim SctId, SbjId, Lan, MsgFrm, MsgCnt, MsgMax,Shw SctId=1 SbjId=1 Lan="F" Shw=1 MsgCnt=1 MsgMax=10 Dim DB Set DB=Server.CreateObject("ADODB.Connection") DB.Open "DSN=grmfrm" Dim MsgLstQ, MsgLstR, MsgId,Nam,Eml,Txt,DatCre,Sta,Snd,Rep MsgLstQ="SELECT MsgId,Nam,Eml,Txt,DatCre,Sta,Snd,Lan,Rep FROM Msg" MsgLstQ=MsgLstQ+" where Lan='E'" MsgLstQ=MsgLstQ+" AND SctId="+CStr(SctId) MsgLstQ=MsgLstQ+" AND SbjId="+CStr(SbjId) MsgLstQ=MsgLstQ+" AND Sta=2" if ( Shw=1 ) then MsgLstQ=MsgLstQ+" AND Shw=true" MsgLstQ=MsgLstQ+" ORDER BY DatCre DESC" Set MsgLstR=DB.Execute(MsgLstQ) %>
<% Dim SpcPos If Not MsgLstR.BOF And Not MsgLstR.EOF Then MsgLstR.MoveFirst Do While Not MsgLstR.EOF MsgId=MsgLstR("MsgId") Nam=MsgLstR("Nam") Eml=MsgLstR("Eml") Txt=MsgLstR("Txt") DatCre=MsgLstR("DatCre") SpcPos=inStr(DatCre," ") if ( SpcPos>0 ) then DatCre=left(DatCre,SpcPos-1) Rep=MsgLstR("Rep") if ( MsgCnt>=MsgFrm ) then %>
  <%=NAM%> <%=DATCRE%>
<%=TXT%>

Our answer

<%=REP%><% Lnk_Show MsgId, "E" %>

<% end if MsgCnt=MsgCnt+1 if (MsgCnt>MsgFrm+MsgMax) then exit do MsgLstR.MoveNext Loop %>
<% if (MsgFrm>0 ) then %> &SbjId=<%=SbjId%>&Lan=<%=Lan%>&MsgFrm=<%=(MsgFrm-MsgMax)%>>previous page <% end if %> <% if (MsgCnt>MsgFrm+MsgMax) then %> &SbjId=<%=SbjId%>&Lan=<%=Lan%>&MsgFrm=<%=(MsgFrm+MsgMax)%>>next page <% end if %>
<% end if %>