hi all
I have some erorr :(
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.
/mypage/news/add_news.asp, line 76
thie is add_news.asp file
<% Option Explicit %>
<!--#include file="common.inc" -->
<%
'Set the response buffer to true as we maybe redirecting
Response.Buffer = True
'Dimension variables
Dim rsAddNewsItem 'Database recordset to add the new News Item
Dim strInputName 'Holds the Users name
Dim strInputEmailAddress 'Holds the Users e-mail address
Dim strInputNewsTitle 'Holds the News Title
Dim strInputNewsItem 'Holds the News Item
Dim lngNewsID 'Holds the News item ID number
Dim strMode 'Holds whether the News Item is new or to be updated
'If the session variable is False or does not exsist then redirect the user to the unauthorised user page
If Session("blnIsUserGood") = False or IsNull(Session("blnIsUserGood")) = True then
'Redirect to unathorised user page
Response.Redirect"unauthorised_user_page.htm"
End If
'Read in the mode of the page and the News ID number
strMode = Request.Form("mode")
If strMode = "edit" Then lngNewsID = CLng(Request.Form("NewsID"))
'Read in user details from the form
strInputName = Request.Form("author")
strInputEmailAddress = Request.Form("email")
strInputNewsTitle = Request.Form("title")
strInputNewsItem = Request.Form("newsItem")
'Write a cookie to store the users name and e-mail so they don't have to keep re-entering it for each news item
Response.Cookies("NewsItem")("Author") = strInputName
Response.Cookies("NewsItem")("Email") = strInputEmailAddress
Response.Cookies("NewsItem").Expires = Now() + 365
'Change the emotion symbols for the path to the relative smiley icon
strInputNewsItem = Replace(strInputNewsItem, ":)", "<img src=""news_images/smiley1.gif"" width=""17"" height=""17"">")
strInputNewsItem = Replace(strInputNewsItem, ";)", "<img src=""news_images/smiley2.gif"" width=""17"" height=""17"">")
strInputNewsItem = Replace(strInputNewsItem, ":o", "<img src=""news_images/smiley3.gif"" width=""17"" height=""17"">")
strInputNewsItem = Replace(strInputNewsItem, ":D", "<img src=""news_images/smiley4.gif"" width=""17"" height=""17"">")
strInputNewsItem = Replace(strInputNewsItem, ":errr:", "<img src=""news_images/smiley5.gif"" width=""17"" height=""17"">")
strInputNewsItem = Replace(strInputNewsItem, ":(", "<img src=""news_images/smiley6.gif"" width=""17"" height=""17"">")
strInputNewsItem = Replace(strInputNewsItem, "X(", "<img src=""news_images/smiley7.gif"" width=""17"" height=""17"">")
'Replace the vb new line code for the HTML new break code
strInputNewsItem = Replace(strInputNewsItem, vbCrLf, "<br>")
'Create recorset object
Set rsAddNewsItem = Server.CreateObject("ADODB.Recordset")
'If the mode is edit then initialise the SQL query to get the Nerws Item to be updated
If strMode = "edit" Then
strSQL = "SELECT tblNews.* FROM tblNews WHERE tblNews.News_ID = " & lngNewsID & ";"
Else
'Initalise the SQL string with a query to read in all the new items from the database
strSQL = "SELECT tblNews.* FROM tblNews;"
End If
'Set the cursor type property of the record set to Dynamic so we can navigate through the record set
rsAddNewsItem.CursorType = 2
'Set the Lock Type for the records so that the record set is only locked when it is updated
rsAddNewsItem.LockType = 3
'Open the recordset
rsAddNewsItem.Open strSQL, strCon
'Add a new record to the recordset if it's a new News Item
If NOT strMode = "edit" Then rsAddNewsItem.AddNew
rsAddNewsItem.Fields("News_title") = strInputNewsTitle <<<< erorr
rsAddNewsItem.Fields("News_item") = strInputNewsItem
rsAddNewsItem.Fields("Author") = strInputName
rsAddNewsItem.Fields("Author_email") = strInputEmailAddress
'Update the database with the new recordset
rsAddNewsItem.Update
'Requery the database to make sure that the News Item has been deleted
'This will make the script wait until Database has updated itself as sometimes Access can be a little slow at updating
rsAddNewsItem.Requery
'Reset Sever Objects
Set adoCon = Nothing
Set strCon = Nothing
Set rsAddNewsItem = Nothing
'If this is an update then go back to the select news item page
If strMode = "edit" then Response.Redirect "select_news_item.asp"
%>
<html>
<head>
<title>Login</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<!-- The Web Wiz Guide ASP Site News Administrator is written by Bruce Corkhill ©2001
If you want your Site News Administrator then goto http://www.webwizguide.com -->
</head>
<body bgcolor="#FFFFFF" text="#000000">
<div align="center"><b><font size="6">Add News Item</font></b> </div>
<div align="center"><a href="admin_menu.asp" target="_self"> Return to the Site
News Administrator Menu</a><br>
</div>
<br>
<br>
<table width="581" border="0" cellspacing="0" cellpadding="1" align="center">
<tr>
<td align="center">You new News Item has been entered into the Database.<br>
<br>
<a href="add_news_form.asp">Enter another News Item</a></td>
</tr>
</table>
</body>
</html>