<%@ Language=VBScript %> <% dim sql dim rs1 dim cn dim sok sok=request.form("sok") husk=request.querystring("husk") id = request.querystring("id") if sok = "" then sok=husk 'Finner side pg=request.querystring("pg") if sok="" then sql = "select id, navn, email, firma, aksept from nbrev where brevID = 1 order by id" else if husk = "" then id = "" end if pg = "" sql = "select id, navn, email, firma, aksept from nhb where (email like '%" & sok & "%' or navn like '%" & sok & "%' or firma like '%" & sok & "%') order by id" end if cnstring = "uid=sa;pwd=kfmdb;Driver={SQL Server};database=KFinfoserie;Server=192.168..25" cnstring = "uid=smskf;pwd=liver1pool;Driver={SQL Server};database=KFInfoserie;Server=192.168.1.118" set cn = server.CreateObject("ADODB.CONNECTION") set rs1 = server.createobject("ADODB.Recordset") cn.Open cnstring rs1.activeconnection=cn rs1.cursortype=3 rs1.pagesize=99 if id <> "" then sql2 = "select aksept from nbrev where id = " & id set rs2 = cn.execute(sql) sql3 = "update nbrev set aksept = abs(aksept - 1) where id = " & id cn.execute(sql3) end if if pg="" then pg=1 ' Response.write sql ' response.write sql2 ' response.write sql3 rs1.Open sql rs1.absolutepage=pg 'response.write sql 'response.write "
søk=" & sok & "
" 'response.write "ID=" & id & "
" 'response.write "Page=" & pg & "
" 'response.write "husk=" & husk & "
" %> Tjenestekatalog  

Søk på navn:


Nedenfor følger en oversikt over alle henvendelser i nyhetsbrevsbasen:

<% i=0 do until rs1.eof or i=>rs1.pagesize i=i+1 %> > <% rs1.movenext loop set cn = nothing %>
ID Navn Email Firma Aksept
<%= rs1("id")%> <%= rs1("navn")%> "><%= rs1("email")%> <%= rs1("firma")%> "><%= rs1("aksept")%>

Gå til side: <% for i=1 to rs1.pagecount if i<>cint(pg) then %> <%=i%> <% else %> <%=i%> <% end if next %>