Melder fejl ved indtastning
Er der nogen, der kan fortælle mig, hvorfor jeg får denne fejlmelding;Microsoft OLE DB Provider for ODBC Drivers error '80040e21'
Multiple-step OLE DB operation generated errors. Check each OLE DB status value, if available. No work was done.
/systematic/add_risogros.asp, line 70
- når jeg taster over 50 bogstaver ind. Min mening er, at der skal poppe en tekst op, hvor der står;
"Beklager, det er ikke lovligt at taste over 50 tegn!", som jeg har kodet i min fil "add_risogros.asp".
Nedenfor har jeg sat de tre filer ind, som vedrører denne side.
sign_risogros.asp:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Systematics homekitchen</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<script language="JavaScript" type="text/JavaScript">
<!--
function MM_preloadImages() { //v3.0
var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}
//-->
</script>
<script language="JavaScript">window.status = ""</script>
<script language="javascript" src="validering.js"></script>
<style type="text/css">
<!--
@import url("systematic.css");
-->
</style>
<style>
BODY { SCROLLBAR-FACE-COLOR: #ffffff;
SCROLLBAR-HIGHLIGHT-COLOR: #ff0000;
SCROLLBAR-SHADOW-COLOR: #cccccc;
SCROLLBAR-3DLIGHT-COLOR: #DFDFDF;
SCROLLBAR-ARROW-COLOR: #ff0000;
SCROLLBAR-TRACK-COLOR: #ffffff;
SCROLLBAR-DARKSHADOW-COLOR: #ffffff
}
</style>
</head>
<body>
<table width="680" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="80"><img src="grafik/trans.gif" width="80" height="30" border="0"></td>
<td> </td>
</tr>
<tr>
<td> </td>
<td valign="top" class="overskrifter"><div align="left">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td><img src="grafik/overskrifter/skrivtilos.gif" width="240" height="24"></td>
</tr>
<tr>
<td><img src="grafik/trans.gif" width="6" height="15"></td>
</tr>
</table>
</div></td>
</tr>
<tr>
<td> </td>
<td class="broedtxt"> <form name="new_comment" action="add_risogros.asp" method="post">
<table border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="84" height="30" class="broedtxt"> Navn</td>
<td width="324" height="30"> <input name="navn" type="text" class="inputfield" size="30">
</td>
</tr>
<tr>
<td height="30"> <span class="broedtxt">E-mail</span></td>
<td height="30"> <input name="email" type="text" class="inputfield" size="30">
</td>
</tr>
<tr>
<td height="30" valign="top" class="broedtxt"> <img src="grafik/trans.gif" width="6" height="2"><br>
Kommentar</td>
<td height="30"><textarea name="text" rows="10" cols="39" wrap="virtual" class="inputfield"></textarea></td>
</tr>
<tr>
<td> </td>
<td height="45"> <input type="hidden" name="StrMode" value="new_comment">
<input name="button" type="button" class="button" onFocus="this.blur()" onClick="validering()" value="tilføj kommentar">
</td>
</tr>
<tr>
<td height="30" colspan="2"> <table border="0" bordercolor="#000000" <% if Session("error") = true then response.write "cellpadding=""5""" else response.write "cellpadding=""0""" end if %> cellspacing="0">
<tr>
<td class="broedtxt" <% if Session("error") = true then response.write "bordercolor=""red""" end if %> >
<%
if Session("error") = true then
response.write "Following mistake has occured<br>" & Session("message")
Session("error") = false
end if
%> </td>
</tr>
</table></td>
</tr>
</table>
</form></td>
</tr>
</table>
</body>
</html>
add_risogros.asp:
<%
'Set the response buffer to true as we maybe redirecting
Response.Buffer = True
strMode = request.form("strMode")
'If the session variable is False or does not exsist then redirect the user to the unauthorised user page
If strMode <> "new_comment" then
'Redirect to user start page
Response.Redirect "index.asp"
End If
'Dimension variables
Dim strInputComments 'Holds the Users comments
Dim saryCommentWord 'Array to hold each word in the comments enetred by the user
Dim intCheckWordLengthLoopCounter 'Loop counter
Dim intWordLength 'Holds the length of the word to be checked
Dim blnWordLenthOK 'Boolean set to False if any words in the description are above 80 characters
Dim intLongestWordLength 'Holds the number of characters in the longest word entered in the
'Read in user deatils from the guestbook form
strInputComments = Request.Form("text")
'Split-up each word in the comments from the user to check that no word entered is over 50 characters
saryCommentWord = Split(Trim(strInputComments), " ")
'Initialse the word length variable
blnWordLenthOK = True
'Loop round to check that each word in the comments entered by the user is not above 70 characters
For intCheckWordLengthLoopCounter = 0 To UBound(saryCommentWord)
'Initialise the intWordLength variable with the length of the word to be searched
intWordLength = Len(saryCommentWord(intCheckWordLengthLoopCounter))
'Get the number of characters in the longest word
If intWordLength => intLongestWordLength Then
intLongestWordLength = intWordLength
End If
'If the word length to be searched is more than or equal to 70 then set the blnWordLegthOK to false
If intWordLength => 80 Then
blnWordLenthOK = False
End If
Next
If blnWordLenthOK = True Then
Set Rs = Server.CreateObject ("ADODB.Connection")
set rec = server.createobject("ADODB.recordset")
Rs.Open "DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=" & server.MapPath("../Systematic/users.mdb")
Rec.open "risogros", Rs, 2, 3
Dim dato
dato = date()
Dim tid
tid = time()
navn = Request ("navn")
email = Request ("email")
comment = Request ("text")
if comment = "" then
comment = "Ingen kommentar er tastet ind!"
end if
Rec.Addnew
Rec("nick") = navn
Rec("email") = email
Rec("text") = comment
Rec("dato") = dato
Rec("tid") = tid
REC.Update
Rec.close
set Rec=nothing
Response.redirect "risogros.asp"
else
Session("error") = true
Session("message") = "Beklager, det er ikke lovligt at taste over 50 tegn!"
Response.redirect "sign_risogros.asp"
end if
%>
risogros.asp:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Systematics homekitchen</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<script language="JavaScript" type="text/JavaScript">
<!--
function MM_preloadImages() { //v3.0
var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}
//-->
</script>
<link href="ego.css" rel="stylesheet" type="text/css">
<style type="text/css">
<!--
@import url("systematic.css");
-->
</style>
<style>
BODY { SCROLLBAR-FACE-COLOR: #ffffff;
SCROLLBAR-HIGHLIGHT-COLOR: #ff0000;
SCROLLBAR-SHADOW-COLOR: #cccccc;
SCROLLBAR-3DLIGHT-COLOR: #DFDFDF;
SCROLLBAR-ARROW-COLOR: #ff0000;
SCROLLBAR-TRACK-COLOR: #ffffff;
SCROLLBAR-DARKSHADOW-COLOR: #ffffff
}
</style>
</head>
<body class="broedtxt">
<table width="680" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="60"><img src="grafik/trans.gif" width="80" height="30" border="0"></td>
<td width="620"></td>
</tr>
<tr>
<td></td>
<td valign="top" class="overskrifter"><table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td><img src="grafik/overskrifter/risogros.gif" width="240" height="24"></td>
</tr>
<tr>
<td><img src="grafik/trans.gif" width="6" height="15"></td>
</tr>
</table></td>
</tr>
<tr>
<td></td>
<td valign="top" class="broedtxt"> <table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td>
<%
' Databaseforbindelse - husk at angive sti til din database
Set Conn = Server.CreateObject("ADODB.Connection")
DSN = "DRIVER={Microsoft Access Driver (*.mdb)}; "
DSN = DSN & "DBQ=" & Server.MapPath("../Systematic/users.mdb")
Conn.Open DSN
' SQL forespørgsel
strSQL = "Select * from risogros order by ID desc"
' Udfør forespørgsel (objRec indeholder nu resultatet)
Set objRec = Conn.Execute(strSQL)
do while not objRec.eof
comment = Replace(objrec("text"), vbCrLf, "<BR>")
response.write "<table border=""1"" bordercolor=""#cccccc"" width=""550"" cellpadding=""20"" cellspacing=""3""><tr><td bordercolor=""#cccccc"">"
response.write "<table width=""550"" align=""center"" cellpadding=""3"" cellspacing=""0""><tr class=""broedtxt""><td background=""system/td_back.gif"">"
response.write "<span class=""overskrifter"">" & objrec("nick") & "</span>"
response.write "</td><td align=""right"" background=""system/td_back.gif"">"
response.write "<a href=mailto:" & objrec("email") & " onFocus=""this.blur()""><img src=grafik/envelope.gif border=0 alt=" & objrec("email") & "></a>"
response.write "</td></tr>"
response.write "<tr><td colspan=""2"">"
response.write "<table class=""broedtxt"" cellpadding=""0"" cellspacing=""0"" width=""100%""><tr><td>"
response.write comment
response.write "</td></tr></table>"
response.write "</td></tr>"
response.write "<tr class=""datotidDB""><td background=""system/td_back2.gif"">"
response.write "date: " & objrec("dato")
response.write "</td><td align=""right"" background=""system/td_back2.gif"">"
response.write "time: " & objrec("tid")
response.write "</td></tr></table>"
response.write "</td></tr></table><br>"
objRec.movenext
loop
' Luk databaseforbindelse
Conn.Close
Set Conn = Nothing
%>
</td>
</tr>
</table></td>
</tr>
</table>
</body>
</html>
Er der en, der hjælpe?
