smlg. 2 datoer
Hvad er der lige galt her?Set Con = Server.CreateObject("ADODB.Connection")
Set Rs = Server.CreateObject("ADODB.Recordset")
Con.Open "DBQ=" & Server.Mappath("../../db/Booking.mdb") & ";Driver={Microsoft Access Driver (*.mdb)};Password=1234;"
SQL = "SELECT * FROM booking WHERE id = " & Request.Form("id") & ""
set rs = con.execute (SQL)
if NOT rs.EOF then
bookeddato = rs("dato")
olddate = Date()
Dato = FormatDateTime(olddate, 2)
if bookeddato < Dato Then
response.write "Du har ikke lov til at slette afholdte bookninger eller bookninger fra idag. Hvis du vil slette en bookning fra i dag så kontakt venligst kokken."
Response.write "<br><br>"
Response.write "<a href=""java script:history.back(-1)"">Tilbage</a>"
Response.write "<TD vAlign=top align=left width=8 " & _
"background=../pics/Design/content_right_middle.gif " & _
"rowSpan=2 height=""43""> </TD></TR> " & _
"<TR>" & _
"<TD vAlign=bottom align=left width=564 bgColor=#CFDFFC " & _
"colSpan=4 height=""26""><IMG height=26 alt="""" " & _
"src=""../pics/Design/newsitem_left_bottom.gif"" width=56 " & _
"border=0></TD></TR></TBODY></TABLE> " & _
"<TABLE cellSpacing=0 cellPadding=0 width=584 border=0> " & _
"<TBODY>" & _
"<TR>" & _
"<TD width=26 bgColor=#ffffff><IMG height=15 alt="""" " & _
"src=""../pics/Design/content_left_bottom.gif"" " & _
"width=26 border=0><BR></TD> " & _
"<TD width=554 bgColor=#FFFFFF><IMG height=15 alt="""" " & _
"src=""../pics/Design/content_bottom.gif"" " & _
"width=558 border=0><BR></TD> " & _
"<TD width=2 bgColor=#ffffff><IMG height=1 alt="""" " & _
"src=""../pics/Design/blank(1).gif"" " & _
"width=2 border=0><BR></TD></TR></TBODY></TABLE>"
Response.End
End If
if Session("auth_Initial") = rs("initialer") OR Session("auth_Gruppenavn") = "Admin" then
sql = "DELETE * From booking Where id = " & Request.Form("id") & ""
Con.Execute(Sql)
response.write "Din booking er nu slettet"
else
response.write "Du har ikke har adgang til at slette denne booking da det ikke er dig der har oprettet den."
end if
else
response.write "Denne booking findes ikke"
end if
con.close
Lige meget om bookeddato er mindre eller større end dato så skriver den Du har ikke lov til at slette afholdte bookninger eller bookninger fra ....
Jeg har prøvet at udskrive bookeddato og dato og får:
15-11-2002
06-11-2002
Whats wrong?
