%@ LANGUAGE="VBSCRIPT" %> <% Option Explicit %> <% '***** dim boks dim errorkod dim search dim what Boks = Request.querystring ("Boks") search = Request.form ("search") If Search = "" then search = request.querystring ("search") end if what = request.querystring ("what") ''****************Om elelr inte ? If search = "" then What = search else What = what End if Errorkod = request.querystring ("errorkod") IF Boks = "" then Dim strSQL 'En case sats här som fixar och trixar lite grann. IF search <> "" then strSQL = "SELECT * FROM comments where Rubrik like '%"&search&"%' or lag like '%"&search&"%' or Text like '%"&search&"%' ORDER BY datum desc" ELSE strSQL ="SELECT * FROM comments ORDER BY datum desc" END IF Else ' på boks strSQL = "SELECT * FROM comments where Rubrik ORDER BY datum desc" End if ' en if på boks '**** 'Set how many records per page we want Const NumPerPage = 10 'Retrieve what page we're currently on Dim CurPage If Request.QueryString("CurPage") = "" then CurPage = 1 'We're on the first page Else CurPage = Request.QueryString("CurPage") End If Dim connection %> <% 'Explicitly Create a recordset object Dim rs Set rs = Server.CreateObject("ADODB.Recordset") 'Set the cursor location property rs.CursorLocation = adUseClient 'Set the cache size = to the # of records/page rs.CacheSize = NumPerPage 'Open our recordset ' Dim strSQL ' strSQL = "SELECT * FROM comments ORDER BY datum desc" rs.Open strSQL, Connection ' här har jag ändrat ! If Rs.eof Then response.redirect "comments.asp?Errorkod=nada" rs.MoveFirst rs.PageSize = NumPerPage 'Get the max number of pages Dim TotalPages TotalPages = rs.PageCount 'Set the absolute page rs.AbsolutePage = CurPage 'Counting variable for our recordset Dim count %>
![]() |