intPage = Request(\"page\") If Len(intPage) = 0 Then intPage = 0 intPage = CInt(intPage)
Sub DoItem(psLink,psWhat) %> jada jada bla bla html osv
<% \' DB åbnes for listing af news Set RS_downloadwads = Server.CreateObject(\"ADODB.RecordSet\") strSQL = \"SELECT * FROM downloadwads ORDER BY id DESC\"
liOffset = MAX_NEWS_PR_PAGE * intPage
RS_downloadwads.Open strSQL, strDSN, 1, 1
liCnt = 1 Do While Not RS_downloadwads.EOF And liCnt < liOffset liCnt = liCnt + 1 RS_downloadwads.MoveNext Loop
liCnt = 0 If Not RS_downloadwads.EOF Then Do While Not RS_downloadwads.EOF And liCnt < MAX_NEWS_PR_PAGE %> <% Response.Buffer = True
Set myConn = Server.CreateObject(\"ADODB.Connection\") myConn.Open \"DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=\" & Server.MapPath(\"/db/pw.mdb\") If Request.QueryString(\"id\") <> \"\" Then Set rs = Server.CreateObject(\"ADODB.RecordSet\") strSQL = \"SELECT * FROM Downloadwads WHERE (ID = \" & Request.QueryString(\"id\") & \")\" rs.Open strSQL, myConn, 1, 3 If Not (rs.BOF Or rs.EOF) Then rs(\"Hits\") = rs(\"Hits\") + 1 strURL = rs(\"URL\") rs.Update rs.Close myConn.Close Set rs = Nothing Set myConn = Nothing Response.Clear Response.Redirect(strURL) End If End If %>
<% strSQL = \"SELECT * FROM Downloadwads ORDER BY Navn\" Set rs = myConn.Execute(strSQL) If Not (rs.BOF Or rs.EOF) Then Do While Not rs.EOF %> <% bgcolor = \"#142D34\" do while not rs.eof %><table align=\"center\" bgcolor=\"<%=bgcolor%>\" border=\"0\" width=\"350\" > <% Response.Write \"<p><a href=listwads.asp?id=\" & rs(\"ID\") & \">\" & rs(\"Navn\") & \"</a><br>\" Response.Write \"<font size=-1>Hits: \" & rs(\"Hits\") & \"</p>\" rs.Movenext Loop
myConn.Close Set myConn = Nothing %> <% if bgcolor=\"#142D34\" then bgcolor=\"#214754\" else bgcolor=\"#142D34\" end if rs.movenext loop %> <% End If %> </table> <% liCnt = liCnt + 1 RS_downloadwads.MoveNext loop If liOffset > 0 Then Response.Write \" <A HREF=\"\"downloadwads.asp?page=\" & intPage - 1 & \"\"\">Previous</A> \" End If If Not RS_downloadwads.EOF Then Response.Write \" <A HREF=\"\"downloadwads.asp?page=\" & intPage + 1 & \"\"\">Next</A> \" End If RS_downloadwads.Close Else Response.Write \"There are no wads at the moment\" End If Set RS_downloadwads = Nothing
Med version 7 af TeamShare tager Lector næste skridt og bygger en platform for AI-agenter, der i højere grad kan følge medarbejderen gennem hele arbejdsprocessen.
her er så resultatet men der er dog fejl i den const max news pr page den er der fejl i den gør så det der skal vises vises x antal gange for meget i stedet for at vise x at pr side. altså hvis der står 12 viser den indholder af db 12 gange .. istedet for at kun vise 12 pr side.. kan i lige spotte fejlen . ellers tak dkharpen.. hva var der galt !!
<!-- #include file=\"adovbs.inc\" -->
<% Response.Expires = 0 Response.Buffer = True
Dim intPage, RS_downloadmaps, strSQL, liOffset, liCnt, strDSN
intPage = Request(\"page\") If Len(intPage) = 0 Then intPage = 0 intPage = CInt(intPage)
Sub DoItem(psLink,psWhat) %> bla bla html osv
<% \' DB åbnes for listing af news Set RS_downloadwads = Server.CreateObject(\"ADODB.RecordSet\") strSQL = \"SELECT * FROM downloadwads ORDER BY id DESC\"
liOffset = MAX_NEWS_PR_PAGE * intPage
RS_downloadwads.Open strSQL, strDSN, 1, 1
liCnt = 1 Do While Not RS_downloadwads.EOF And liCnt < liOffset liCnt = liCnt + 1 RS_downloadwads.MoveNext Loop
liCnt = 0 If Not RS_downloadwads.EOF Then Do While Not RS_downloadwads.EOF And liCnt < MAX_NEWS_PR_PAGE %> <% Response.Buffer = True
Set myConn = Server.CreateObject(\"ADODB.Connection\") myConn.Open \"DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=\" & Server.MapPath(\"pw.mdb\") If Request.QueryString(\"id\") <> \"\" Then Set rs = Server.CreateObject(\"ADODB.RecordSet\") strSQL = \"SELECT * FROM Downloadwads WHERE (ID = \" & Request.QueryString(\"id\") & \")\" rs.Open strSQL, myConn, 1, 3 If Not (rs.BOF Or rs.EOF) Then rs(\"Hits\") = rs(\"Hits\") + 1 strURL = rs(\"URL\") rs.Update rs.Close myConn.Close Set rs = Nothing Set myConn = Nothing Response.Clear Response.Redirect(strURL) End If End If %>
<% Set myConn = Server.CreateObject(\"ADODB.Connection\") myConn.Open \"DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=\" & Server.MapPath(\"pw.mdb\") Set rs = Server.CreateObject(\"ADODB.RecordSet\") strSQL = \"SELECT * FROM Downloadwads ORDER BY Navn\" Set rs = myConn.Execute(strSQL) If Not (rs.BOF Or rs.EOF) Then Do While Not rs.EOF %> <% bgcolor = \"#142D34\" %><table align=\"center\" bgcolor=\"<%=bgcolor%>\" border=\"0\" width=\"350\" > <% Response.Write \"<p><a href=listwads.asp?id=\" & rs(\"ID\") & \">\" & rs(\"Navn\") & \"</a><br>\" Response.Write \"<font size=-1>Hits: \" & rs(\"Hits\") & \"</p>\" if bgcolor=\"#142D34\" then bgcolor=\"#214754\" else bgcolor=\"#142D34\" end if rs.Movenext Loop rs.Close myConn.Close end if Set rs = Nothing Set myConn = Nothing %>
</table> <% RS_downloadwads.MoveNext liCnt = liCnt + 1 loop If liOffset > 0 Then Response.Write \" <A HREF=\"\"listwads.asp?page=\" & intPage - 1 & \"\"\">Previous</A> \" End If If Not RS_downloadwads.EOF Then Response.Write \" <A HREF=\"\"listwads.asp?page=\" & intPage + 1 & \"\"\">Next</A> \" End If RS_downloadwads.Close Else Response.Write \"There are no wads at the moment\" End If Set RS_downloadwads = Nothing
%> bla bla html og noget mere
Synes godt om
Ny brugerNybegynder
Din løsning...
Tilladte BB-code-tags: [b]fed[/b] [i]kursiv[/i] [u]understreget[/u] Web- og emailadresser omdannes automatisk til links. Der sættes "nofollow" på alle links.