<% Response.Buffer = True Session.LCID = 1053 If Request.Form("catid") = "" Then strCat = Request.QueryString("catid") Else strCat = Request.Form("catid") End If intPageSize = 25 intPage = Request.QueryString("page") If intPage = "" Then intPage = 1 Function FormatStr(String) on Error resume next String = Replace(String, CHR(13), "") String = Replace(String, CHR(10) & CHR(10), "

") String = Replace(String, CHR(10), "
") FormatStr = String End Function '===================================================================================================================== 'Öppnar databasen '===================================================================================================================== Set Connect = Server.CreateObject("ADODB.Connection") Connect.Open "driver={Microsoft Access Driver (*.mdb)};uid=;pwd=gurkmeja;dbq=" & Server.MapPath("../../../data/recept.mdb") Set RSShow = Server.CreateObject("ADODB.Recordset") If Request.QueryString("what") = "search" Then Set RSCat = Server.CreateObject("ADODB.Recordset") Cat = "SELECT * FROM Category WHERE ID = " & strCat & "" RSCat.Open Cat, Connect, adOpenStatic, adLockOptimistic End If If Request.QueryString("what") = "all" Or Request.QueryString("what") = "" Then Visa = "SELECT Recept.*, Category.Category FROM Recept INNER JOIN Category ON Recept.CatID = Category.ID ORDER BY Namn" ElseIf Request.QueryString("what") = "search" Then Visa = "SELECT Recept.*, Category.Category FROM Recept INNER JOIN Category ON Recept.CatID = Category.ID WHERE Recept.CatID = " & strCat & " ORDER BY Namn" End If With RSShow .ActiveConnection = Connect .Source = Visa .PageSize = intPageSize .CursorType = 3 .LockType = 1 .Open End With %> Länkar

<% If Request.QueryString("what") = "all" Or Request.QueryString("what") = "" Then %> Visar Alla Recept!

<% ElseIf Request.QueryString("what") = "search" Then %> Visar Recept i Kategori: <% =RSCat("Category") %>

<% End If %>
<% If Not RSShow.EOF Then RSShow.AbsolutePage = intPage intTotalPages = RSShow.PageCount Call PageNavigation(intPage, intTotalPages) %> <% x = 0 Do Until RSShow.EOF OR intCounter >= intPageSize intCounter = intCounter + 1 If x mod 2 = 0 Then bgcolor = "" & strTblBkgndM & "" Else bgcolor = "" & strTblBkgndL & "" End If %> <% x = x + 1 RSShow.MoveNext Loop RSShow.Close Set RSShow = Nothing Connect.Close Set Connect = Nothing %>
Recept Kategori
"><% =RSShow("Namn") %>  <% =RSShow("Category") %> 

<% Call PageNavigation(intPage, intTotalPages) Else Response.Write "
Inga Recept hittade..." End If %>