Solved

Multiple-step OLE DB operation generated errors: works in development

Posted on 2006-10-24
21
319 Views
Last Modified: 2008-02-01
I am getting an error after moving from development to a production server:
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.

/newticketsave.asp, line 35

The line is:
    rs("TK_DETAIL") = Request.Form("TK_DETAIL")

I can run the page local using the same data and pages and it works.  On the production server, it errors out. (development is XP Pro SP2 IIS5, production is Server2003 IIS6)  Checked spelling, form, etc.  Field allows for nulls but the data it's passing is not null.

Thanks,

Traigo
0
Comment
Question by:traigo
  • 11
  • 5
  • 3
  • +2
21 Comments
 
LVL 12

Expert Comment

by:sandip132
Comment Utility
Try using this structure of connectionstring.

connStr= "driver={MySQL ODBC 3.51 Driver};server=localhost;uid=userid;pwd=password;database=database;Option=16387;"
0
 
LVL 12

Expert Comment

by:sandip132
Comment Utility
Usually this error rises in a case if there is a mismatch between the
datatype in a database and the value that application tries to insert. For
example, if your field is numeric in a database and you try to insert a
string, you could get this error.  TRy checking your query and passed values to database.

REgards,
Sandip.
0
 
LVL 6

Expert Comment

by:ksbhat
Comment Utility
See if these links help
http://support.microsoft.com/kb/269495

0
 
LVL 1

Expert Comment

by:jethropassing
Comment Utility
I have even got this error if the error actually exists on another line.  So instead of just checking your field "TK_DETAIL" make sure you check the other field in the table or tables you are updating.  Look at date field especially.  What I do is delete part of my code at a time until it starts working to find what is really generating that error.

Good Luck
0
 

Author Comment

by:traigo
Comment Utility
ksbhat, link doesn't work

sandip132, I'm not using MySQL.  I am using MSSQL 2005.  I found some information about mismatched datatypes but my filed is set to nvarchar(max) and I'm trying to save text to the field.  It's only about 15 characters.

jethropassing, I'll look.  But it's interesting that the exact same page works in SQL Express 2005 on my local IIS5 but when I move to SQL 2005 on IIS6 it doesn't.  Just copy and paste the pages.  They are identical.
0
 

Author Comment

by:traigo
Comment Utility
I commented out that one line and I was able to save records.  
0
 

Author Comment

by:traigo
Comment Utility
Not sure if it helps but it's the only nvarchar(max) and the only field in the record larger than 254
0
 
LVL 1

Expert Comment

by:jethropassing
Comment Utility
You might have tried this but, can you update this field with any other content.  Such as try:

rs("TK_DETAIL") = "Testing this field"

And see if you can get this field to take any update info.  If this works,then check to see what the asp page is getting from Request.Form("TK_DETAIL") Such as:

Response.Write Request.Form("TK_DETAIL")

There might be a hyphen or a on reqonizable charactor in this Request.Form("TK_DETAIL") string.


0
 

Author Comment

by:traigo
Comment Utility
jethropassing, I get the same error by just putting some text in there rather than trying to pull from the form
0
 

Author Comment

by:traigo
Comment Utility
I'm going through the rest of my pages now and I'm finding that I'm having the problem with the same field on multiple pages so I think it's something to do with SQL2005.
0
How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

 
LVL 1

Expert Comment

by:jethropassing
Comment Utility
Can you change the data type to varchar my preferance.  Check out:


http://www.firebirdsql.org/manual/migration-mssql-data-types.html
0
 

Author Comment

by:traigo
Comment Utility
I'm upgrading SQL right now to the newest version to see if that helps.  I was running SP1 local and pre-sp1 production.  I didn't realize they had released an SP1 yet and forgot how long ago I installed it on my server.
0
 

Author Comment

by:traigo
Comment Utility
now I'm on v9.0.2047 and I don't get the error anymore, but it stops at that line still and I get a blank page.  I used response.write "made it here" before and after the line.  On the page I get the first but not the second.  Debugger doesn't come up on the server either.

I changed to varchar(max) and had the same result
I changed to nvarchar(100) and it worked.
0
 
LVL 1

Expert Comment

by:jethropassing
Comment Utility
I have never used varchar(max)

I would use varchar(250)
0
 

Author Comment

by:traigo
Comment Utility
The field has the potential for storing large amounts of text.  It's supposed to be similar to a blob or memo data type.
0
 
LVL 1

Accepted Solution

by:
jethropassing earned 500 total points
Comment Utility
Can you use text()
0
 

Author Comment

by:traigo
Comment Utility
I've tried looking up the datatypes and can't really find a difference between text/ntext and varchar(max)/nvarchar(max).  I remember working with memo and blob fields.  They had problems with storing and retrieving carriage returns.  When saving and displaying, I had to do a replace to convert them to the correct type.  Is this true with text()?
0
 
LVL 12

Expert Comment

by:sandip132
Comment Utility
Please store your sql query in a string variable, response the output to the page.

string YourQuery="Insert into............"

check in query analyser Or Paste your sqlquery here.

OR

Check whether you are inserting same values in any Primary key column.

Regards,
Sandip.
0
 

Author Comment

by:traigo
Comment Utility
text, or rather ntext, works for all my forms now.  The only thing I had to change was where I concantenated fields.  I was using SQL + to do so.  Now I am doing it in VB on the page.

Thanks for the help!
0
 
LVL 75

Expert Comment

by:Anthony Perkins
Comment Utility
If you can you should use varchar(max) instead of Text.  You will find that the Text data type is very limiting (as you are starting to find out).  The reason varchar(max) is causing you grief I suspect is because your database is set to 8.0 (SQL Server 2000) which does not support varchar(max)
0
 

Author Comment

by:traigo
Comment Utility
How might I change it to not be?
0

Featured Post

Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
Round to 2 decimal places 2 36
Syntax Help on SP 4 52
Update static table with two columns and multiple rows... 15 81
Issue with Loop 4 41
Hello, all! I just recently started using Microsoft's IIS 7.5 within Windows 7, as I just downloaded and installed the 90 day trial of Windows 7. (Got to love Microsoft for allowing 90 days) The main reason for downloading and testing Windows 7 is t…
I would like to start this tip/trick by saying Thank You, to all who said that this could not be done, as it forced me to make sure that it could be accomplished. :) To start, I want to make sure everyone understands the importance of utilizing p…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.

728 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now