Min gæstebog skriver/viser denne fejl, hvorfor gør den det.????
Kommentar:Microsoft VBScript runtime error '800a005e'
Invalid use of Null: 'Replace'
/gb.asp, line 61
___________________________________________________________
Her er hele kodesættet..
<% Option Explicit %>
<% response.Buffer = TRUE
response.expires = 0
%>
<!--#include file="adovbs.inc"-->
<% dim Connect, gbRS, Query, stille, mode, navn, email, besked, gbwelcome2, maaned, text, nick, icq, http,fejl, msg,deleteArr, i, sql
mode = request("mode")
Set Connect = Server.CreateObject("ADODB.Connection")
Connect.Open "DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=" & Server.MapPath("gosche.mdb")
Set gbRS = Server.CreateObject("ADODB.Recordset")
Query = "SELECT * FROM gb ORDER BY dato DESC"
gbRS.Open Query, Connect, adOpenStatic, adLockOptimistic
%>
<html>
<head>
<title></title>
</head>
<body BGCOLOR="#FFFFD0" TEXT="#800080" ALINK="#008080" VLINK="#D03498" LINK="#993366">
<%if mode = "" then %>
<div align="center">
<table>
Velkommen Dianna's gæstebog
<br>
<br>
<div align="center">
<a href="gb.asp?mode=write">Skriv i Dianna's gæstebog</a>
</div>
</table>
<br>
<br>
<table>
<% do until gbRS.EOF %>
<tr>
<td width="600">
Navn: <%=gbRS("Navn")%><br>
Nickname: <%=gbRS("Nick")%><br>
Email: <a href="mailto:<%=gbRS("e-mail")%>"><%=gbRS("e-mail")%></a><br>
ICQ: <%=gbRS("Icq")%><br>
<% Select Case month(gbRS("Dato"))
case 1 maaned = " jan. "
case 2 maaned = " feb. "
case 3 maaned = " mar. "
case 4 maaned = " apr. "
case 5 maaned = " maj "
case 6 maaned = " jun. "
case 7 maaned = " jul. "
case 8 maaned = " aug. "
case 9 maaned = " sep. "
case 10 maaned = " okt. "
case 11 maaned = " nov. "
case 12 maaned = " dec. "
end select
%>
Hjemmeside: <a href="<%=gbRS("http")%>"><%=gbRS("http")%></a><br>
Dato: <%Response.Write day(gbRS("Dato")) & maaned & year(gbRS("Dato"))%><br>
<br>
<b>Kommentar:</b><br>
<br>
<% text = Replace(gbRS("kommentar"), VbCrLf, "<BR>")%>
<%=text%>
<hr>
</td>
</tr>
<%
gbRS.MoveNext
loop
%>
</table>
</div>
<% end if %>
<% if mode = "write" then %>
<div align="center">
Skriv en hilsen i min gæstebog:<br>
<br>
<table>
<form method="POST" action="gb.asp?mode=addit">
<tr>
<td>Navn:</td>
<td><input type="text" name="navn"></td>
</tr>
<tr>
<td>Nickname:</td>
<td><input type="text" name="nick"></td>
</tr>
<tr>
<td>ICQ:</td>
<td><input type="text" name="icq"></td>
</tr>
<tr>
<td>Email:</td>
<td><input type="text" name="email"></td>
</tr>
<tr>
<td>Hjemmeside:</td>
<td><input type="text" name="http"></td>
</tr>
<tr>
<td valign="top">Kommentar:</td>
<td>
<textarea rows="10" cols="25" name="hilsen"></textarea>
</td></tr>
</table>
<input type="submit" value=" send hilsen " name="B1">
</form>
</table>
</div>
<% end if %>
<% if mode ="addit" then %>
<%
Navn = Request.Form("Navn")
Email = Request.Form("Email")
Besked = Request.Form("Hilsen")
nick = Request.Form("nick")
icq = Request.Form("icq")
http = Request.Form("http")
gbRS.AddNew
gbRS("Navn") = Navn
gbRS("nick") = Nick
gbRS("icq") = icq
gbRS("http") = http
gbRS("E-mail") = Email
gbRS("kommentar") = Besked
gbRS("dato") = Now
gbRS.Update
Response.Redirect("gb.asp")
%>
<%end if %>
<%if mode = "admin" then %>
<%
fejl = ""
If Request("Submit")<>"" Then
If Request("navn") = "gosche" and _
Request("password")="gosche" Then
Session("Valid") = Request("navn")
Response.redirect "gb.asp?mode=administrate"
Else
fejl = "Forkert brugernavn eller password. Prøv igen!"
End If
End If
%>
<form action="gb.asp?mode=admin" method="post">
<div align="center">
<table><tr><td></td>
<td colspan="2"><font color="#000000" face="verdana" size="2"><b></b></font></td></tr>
<%If fejl <> "" Then%>
<tr><td></td>
<td colspan="2"><center><font size=1 face=verdana color=red><%=fejl%></font></center> </td></tr>
<%End If%>
<tr> <td></td>
<td><font size=2 face=verdana>Brugernavn:</font></td>
<td><Input type="text" name="navn"></td></tr>
<tr><td></td>
<td ><font size=2 face=verdana>Password: </font></td>
<td><input type="password" name="password"></td></tr>
<tr><td></td>
<td colspan="2"><center><input type="submit" name="submit" value="Login" class="button"></center> </td></tr>
<tr><td></td>
<td colspan="2"><center><font size=2 face=verdana></font></center></td>
</tr>
</table>
</div>
</form>
<%end if %>
<% if mode = "administrate" then %>
<%
If Session("Valid") = "" Then
Response.redirect "gb.asp?mode=admin"
End If
%>
<% msg = request("msg")
if msg = "slette" then %>
De valgte beskeder er nu slettet<br>
<br>
<%end if %>
Her administrerer du din gæstebog, her vil blive vist navn, nick og dato på indlæggene.<br>
<br>
<br>
<table>
<Form method="post" action="gb.asp?mode=slet" name="delete">
<input type="submit" value="Slet Beskeder">
<% do until gbRS.EOF %>
<tr>
<td>
<input type="checkbox" name="delete" value="<%=gbrs("ID")%>">
</td>
<td>
Navn: <%=gbRS("Navn")%><br>
Nickname: <%=gbRS("Nick")%><br>
<% Select Case month(gbRS("Dato"))
case 1 maaned = " jan. "
case 2 maaned = " feb. "
case 3 maaned = " mar. "
case 4 maaned = " apr. "
case 5 maaned = " maj "
case 6 maaned = " jun. "
case 7 maaned = " jul. "
case 8 maaned = " aug. "
case 9 maaned = " sep. "
case 10 maaned = " okt. "
case 11 maaned = " nov. "
case 12 maaned = " dec. "
end select
%>
Dato: <%Response.Write day(gbRS("Dato")) & maaned & year(gbRS("Dato"))%><br>
</td>
</tr>
<%
gbRS.MoveNext
loop
%>
</form>
</table>
<% end if %>
<%
If Session("Valid") = "" Then
Response.redirect "gb.asp?mode=admin"
End If
%>
<% if mode = "slet" then
deleteArr = Split(request.form("delete"), ",")
FOR i=0 TO Ubound(deleteArr)
sql = "delete from gb where id = " & deleteArr(i)
connect.execute(sql)
NEXT
Response.Redirect("gb.asp?mode=administrate&msg=slette")
%>
<%end if%>
</body>
</html>
<%
Connect.close
set Connect = nothing
%>