• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 341
  • Last Modified:

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

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
traigo
Asked:
traigo
  • 11
  • 5
  • 3
  • +2
1 Solution
 
sandip132Commented:
Try using this structure of connectionstring.

connStr= "driver={MySQL ODBC 3.51 Driver};server=localhost;uid=userid;pwd=password;database=database;Option=16387;"
0
 
sandip132Commented:
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
 
ksbhatCommented:
See if these links help
http://support.microsoft.com/kb/269495

0
Never miss a deadline with monday.com

The revolutionary project management tool is here!   Plan visually with a single glance and make sure your projects get done.

 
jethropassingCommented:
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
 
traigoAuthor Commented:
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
 
traigoAuthor Commented:
I commented out that one line and I was able to save records.  
0
 
traigoAuthor Commented:
Not sure if it helps but it's the only nvarchar(max) and the only field in the record larger than 254
0
 
jethropassingCommented:
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
 
traigoAuthor Commented:
jethropassing, I get the same error by just putting some text in there rather than trying to pull from the form
0
 
traigoAuthor Commented:
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
 
jethropassingCommented:
Can you change the data type to varchar my preferance.  Check out:


http://www.firebirdsql.org/manual/migration-mssql-data-types.html
0
 
traigoAuthor Commented:
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
 
traigoAuthor Commented:
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
 
jethropassingCommented:
I have never used varchar(max)

I would use varchar(250)
0
 
traigoAuthor Commented:
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
 
jethropassingCommented:
Can you use text()
0
 
traigoAuthor Commented:
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
 
sandip132Commented:
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
 
traigoAuthor Commented:
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
 
Anthony PerkinsCommented:
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
 
traigoAuthor Commented:
How might I change it to not be?
0

Featured Post

Never miss a deadline with monday.com

The revolutionary project management tool is here!   Plan visually with a single glance and make sure your projects get done.

  • 11
  • 5
  • 3
  • +2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now