%
intantaltider=15
valtantal = Cint(request.querystring("antal"))
' Kopplingen till databasen
Set Conn = Server.CreateObject("ADODB.Connection")
Conn.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & Server.MapPath("db/bio.mdb")
If Request.QueryString("delete") <> "" Then
SQL = "Delete From bio Where id = " & Request.QueryString("delete")
Conn.Execute(SQL)
Response.Redirect "admin.asp"
End If
If Request.QueryString("do") = "add" Then
addloop=1
do until addloop = valtantal +1
titel = Request.Form("titel")
beskr = Request.Form("text")
vecka = Request.Form("vecka" & addloop)
dag = Request.Form("dag" & addloop)
bild = Request.Form("bild" & addloop)
starttid= Request.Form("tid")
pris = Request.Form("pris")
' SQL = "Insert Into bio(titel) Values('" & titel & "')"
SQL = "Insert Into bio(titel, beskr, vecka, dag, bild, starttid, pris) Values('" & titel & "', '" & beskr & "',"_
& vecka & ", " & dag & ", '" & bild & "', '" & starttid &"', '" & pris & "')"
Response.Write(SQL)
'Conn.Execute(SQL)
addloop = addloop+1
loop
'Conn.Close
'Set Conn = nothing
End If
%>
Admin sidan
LÄGG TILL EN HÄNDELSE
SAMTLIGA HÄNDELSER
<%
SQL = "Select * From bio Order By id desc"
Set RS = Conn.Execute(SQL)
Do Until RS.EOF
Response.Write "" & RS("titel") & " (" & RS("vecka") & "-" & RS("dag") & ")" & "TABORT "
RS.MoveNext
Loop
RS.Close
Set RS = nothing
Conn.Close
Set Conn = nothing
%>
|
|
<%END IF%>