Wrox Programmer Forums
|
Classic ASP Databases Discuss using ASP 3 to work with data in databases, including ASP Database Setup issues from the old P2P forum on this specific subtopic. See also the book forum Beginning ASP.NET Databases for questions specific to that book. NOT for ASP.NET 1.0, 1.1, or 2.0.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Classic ASP Databases section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old June 7th, 2004, 11:02 AM
Registered User
 
Join Date: Jun 2004
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default Error '80040e21'

I have recently created a site which uses ASP to call a Recordset from a MySQL database to populate a list of news items. When you click on the item, you get the full information for that item. On my RAQ4 system, everything works fine:

Preview Site:

http://www.globalgraphics.co.uk/cox/...ail.asp?ID=348

But when I upload it to the live host (a Microsoft 2000 server), I get the message:

Code:
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.
/news-detail.asp, line 225
Live site:

http://www.cox-hire.com/news-detail.asp?ID=348

Does anybody know what this relates to and why its happening? I have contacted the other host company and the technician thought that it was due to outdated ODBC drivers on my machine, as the MySQL database resides there - but I'm pretty sure that isn't the cause of it.

If anyone can help me - please do! I've Googled the error number and found:

DB_E_DATAFIELD_OVERFLOW
80040E21
OLE DB Specific:

The field is too small to accept the amount of data you attempted to add. Try inserting or pasting less data.

on the Microsoft site, but I don't know where to make the changes, or even if that will sort it. Surely it can't be that as it works on the preview site?

I'm confused...


 
Old June 7th, 2004, 01:26 PM
Friend of Wrox
 
Join Date: Jan 2004
Posts: 303
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I generally receive this error when size of the database field is too small for the posted data. Would you post /news-detail.asp, line 225?
 
Old June 7th, 2004, 10:01 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 2,480
Thanks: 0
Thanked 1 Time in 1 Post
Default

Hi Stingly,

It would be better if you could post the code on line 255 including some lines above and below the line that causes this error. That should show some light on this.

Cheers!

_________________________
-Vijay G
Strive for Perfection
 
Old June 8th, 2004, 03:20 AM
Registered User
 
Join Date: Jun 2004
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I don't think it'll help you to be honest, but I'm more than willing to post it anyway!

Code:
<p><b><%=(Recordset2.Fields.Item("MainTitle1").Value)%></b></p>
<p class="bdytxt"><img src="edit/files/<%=(Recordset2.Fields.Item("Pic1").Value)%>" align="right" hspace="25"><b><%=(Recordset2.Fields.Item("Title1").Value)%></b></p>
LINE 225: <p class="bdytxt"><%=(Recordset2.Fields.Item("Paragraph1").Value)%></p>
<p class="bdytxt"><b><%=(Recordset2.Fields.Item("Title2").Value)%></b></p>
<p class="bdytxt"><%=(Recordset2.Fields.Item("Paragraph2").Value)%></p>
<p class="bdytxt"><%=(Recordset2.Fields.Item("Title3").Value)%></p>
<p class="bdytxt"><%=(Recordset2.Fields.Item("Paragraph3").Value)%></p>
<p class="bdytxt">&nbsp;</p>
These are lines 223 to 230 inclusive. The daft thing is that these are correctly pulled from the database as they display the actual newspage info. The bit thats missing is the entire right column (see links above)...

 
Old June 8th, 2004, 10:59 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 2,480
Thanks: 0
Thanked 1 Time in 1 Post
Default

Hi,

You can use it this way too for more readablilty

Your code
Code:
Recordset2.Fields.Item("Title1").Value
Can be used as
Code:
Recordset2("Title1")
The question I have now is
1) Can you post the Select Statement that you used in this page?
2) What datatype is Paragraph1 in your database?
3) Does that error occur just after displaying Paragaraph1 Value?

If "Yes" for 3rd Question, then I feel your select statement could be fine tuned to resolve this.
Are you using it this way ?
Code:
"Select * from TABLE_NAME"
If so try this one instead. (follow this Order in the selectlist)
Code:
"Select MainTitle1, Pic1, Title1, Title2, Title3, Paragraph1, Paragraph2, Paragraph3 from TABLE_NAME ...."
Hope that Helps.
Cheers!

_________________________
-Vijay G
Strive for Perfection
 
Old June 9th, 2004, 05:17 AM
Registered User
 
Join Date: Jun 2004
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default

OK - Here is the code for the SELECT statement (I've included a bit extra too - just for good measure!)

Code:
<%
Dim Recordset2__MMColParam
Recordset2__MMColParam = "1"
if (Request.QueryString("ID") <> "") then Recordset2__MMColParam = Request.QueryString("ID")
%>
<%
set Recordset2 = Server.CreateObject("ADODB.Recordset")
Recordset2.ActiveConnection = MM_globalnews_STRING
Recordset2.Source = "SELECT * FROM news WHERE ID = " + Replace(Recordset2__MMColParam, "'", "''") + ""
Recordset2.CursorType = 0
Recordset2.CursorLocation = 2
Recordset2.LockType = 3
Recordset2.Open()
Recordset2_numRows = 0
%>
The datatype for Paragraph1 is "longtext". I'd love to try that fix (and will do soon) but the sites server is down at the moment! Typical. I'll let you know if it works though...

 
Old June 9th, 2004, 10:38 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 2,480
Thanks: 0
Thanked 1 Time in 1 Post
Default

Hi,

Yes, it looks like your code was upto my guess.

Try and let us know once your server is up.

Good luck.
Cheers!

_________________________
-Vijay G
Strive for Perfection
 
Old June 10th, 2004, 03:33 AM
Registered User
 
Join Date: Jun 2004
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default

OK - I tried changing the select statement as suggested but it didn't make any difference at all - the page stil displays the same error...

Do you think that it could be an issue with the datatype? Do Microsoft 2000 Servers not recognise certain datatypes - or do you think that there might be an issue with pulling info from a Linux system? Basically the MySQL db is on our Raq4 server and the site that references it is on a MS 2000 server - I'm thinking that there might be some kind of compatability issue - but I thought that ODBC and OLE DB was supposed to eliminate that?






Similar Threads
Thread Thread Starter Forum Replies Last Post
Insert Query Error & Run-Time Error 3022 DavidWE Access 1 July 31st, 2008 11:17 AM
Ch 4: Parse error: syntax error, unexpected T_SL hanizar77 BOOK: Beginning PHP5, Apache, and MySQL Web Development ISBN: 978-0-7645-7966-0 0 June 23rd, 2008 09:17 PM
Parse error: syntax error, unexpected T_STRING ginost7 Beginning PHP 1 November 9th, 2007 02:51 AM
Run-time error '-2147217887(80040e21) Freddyfred Access 8 February 14th, 2005 12:39 AM
Phile Page error, visual studio error reps BOOK: ASP.NET Website Programming Problem-Design-Solution 0 September 27th, 2003 10:11 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.