Fejl på en opret nyhed side
HejsaKan ikke oprette nyheder i mit nyheds system hvorfor ?
Microsoft OLE DB Provider for ODBC Drivers error '80004005'
[Microsoft][ODBC Microsoft Access Driver] Operation must use an updateable query.
/admin/nyhed.asp, line 21
----------------------------------------------------------------
NYHED.ASP SIDEN :
<!---#include file="protect.inc"--->
<%
Response.Buffer = True
' Funktion der fikser quotes...
FUNCTION fixQuotes( theString )
fixQuotes = Replace( theString, "'", "''" )
END FUNCTION
Nyhed = Request( "Nyhed" )
Forfatter = Request( "Forfatter" )
Tema = Request( "Tema" )
Set Con = Server.CreateObject( "ADODB.Connection" )
DBPath = "DBQ=" & server.mappath("Database.mdb")
Con.Open "DRIVER={Microsoft Access Driver (*.mdb)}; " & DBPath
IF Request.Servervariables("Content_Length") > 0 THEN
Sql = "INSERT INTO nyheder (Dato, Nyhed, Forfatter, Tema) VALUES('" & Date() & "','" & fixQuotes( Nyhed ) & "','" & fixQuotes( Forfatter ) & "','" & fixQuotes( Tema ) & "')"
Con.Execute Sql
Response.Write "<strong>Tak for din nyhed. Den er blevet tilføjet til databasen. </strong>"
END IF
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<title>Nyhedsting</title>
<link rel=stylesheet type="text/css" href="../style/stylenormal.css">
</head>
<body bgproperties="fixed" background="../back1.jpg">
<h1><font size="2" face="Verdana">Send en Nyhed
</font></h1>
<br>
<br><br>
<form action="nyhed.asp" method="POST" target="_self">
<table border="0" width="100%" style="border-collapse: collapse" bordercolor="#111111" cellpadding="0" cellspacing="0" height="177">
<tr>
<td valign="top" width="150" height="102"><font face="Verdana" size="1">Din Nyhed</font></td>
<td height="102">
<textarea cols="30" rows="8" name="Nyhed" style="font-family: Verdana; font-size: 10 px; border: 3px double #808080; background-color: #C0C0C0"></textarea></td>
</tr>
<tr>
<td height="26"><font size="1" face="Verdana">Forfatter</font></td>
<td height="26">
<input type="text" name="Forfatter" size="20" style="font-family: Verdana; font-size: 10 px; border: 3px double #808080; background-color: #C0C0C0"></td>
</tr>
<tr>
<td height="27"><font size="1" face="Verdana">Tema</font></td>
<td height="27">
<select size="1" name="tema" style="font-family: Verdana; font-size: 10 px; border: 3px double #808080; background-color: #C0C0C0">
<option selected>>>>TEMA<<<</option>
<option>Kursus</option>
<option>General Nyheder</option>
<option>Krystaller</option>
<option>Figure</option>
<option>Fengshui</option>
<option>Encaustic</option>
<option>Multimedia</option>
</select></td>
</tr>
<tr>
<td colspan="2" align="center" height="22">
<input type="submit" value="Send Din Nyhed" style="font-family: Verdana; font-size: 10 px; border: 3px double #808080; background-color: #C0C0C0"></td>
</tr>
</table>
</form>
</body>
</html>
