Snitz Forums 2000
Snitz Forums 2000
Home | Profile | Register | Active Topics | Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 Community Forums
 Code Support: ASP (Non-Forum Related)
 Multiple-step OLE DB operation generated errors
 New Topic  Topic Locked
 Printer Friendly
Author Previous Topic Topic Next Topic  

khalid
New Member

Saudi Arabia
51 Posts

Posted - 25 February 2002 :  04:44:22  Show Profile
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>


HuwR
Forum Admin

United Kingdom
20595 Posts

Posted - 25 February 2002 :  05:07:19  Show Profile  Visit HuwR's Homepage
your problem isthat one of your fields is a memo, and you are using select * (not a very good idea even if you didn't)


you should explicitly select the fields in the statement, making sure that any memo/blob fields are the last felds in the list. If there is more than one, you should assign them to variables imediately the query has executed, and in the same order that they appear in the select list. plus assign them before you assign any other fields to variables.

Go to Top of Page

Gremlin
General Help Moderator

New Zealand
7528 Posts

Posted - 25 February 2002 :  05:14:57  Show Profile  Visit Gremlin's Homepage
You might want to try posting a message at the official support forums for this also http://www.webwizguide.info/forum



www.daoc-halo.com
Go to Top of Page

khalid
New Member

Saudi Arabia
51 Posts

Posted - 28 February 2002 :  04:56:20  Show Profile
Gremlin & HuwR


quote:

Allot of people do use the Site News Application (which I guess by the page name in the error you are using) on Brinkster without any propblems and it's not unheard of for Brinkster servers to have problems, so I would sign up again for a new Brinkster account and try the app on that and see if it works.


http://www.webwizguide.info/forum/display_topic_threads.asp?ForumID=23&TopicID=1512&PagePosition=1


Go to Top of Page

HuwR
Forum Admin

United Kingdom
20595 Posts

Posted - 28 February 2002 :  05:39:36  Show Profile  Visit HuwR's Homepage
khalid, reread my post, it tells you exactly what causes your error. it is nothing to do with brinkster or permissions it is to do with the OLE driver and the orderring of fields.

Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Topic Locked
 Printer Friendly
Jump To:
Snitz Forums 2000 © 2000-2021 Snitz™ Communications Go To Top Of Page
This page was generated in 0.22 seconds. Powered By: Snitz Forums 2000 Version 3.4.07