...

View Full Version : ASP - mySql TEXT field type problem



dushy_d
05-06-2006, 09:48 PM
Hello,

I am working with ASP and A mySql DB
I have a table with a field "F_NAME" with the mySql TEXT type

when i try to insert or update i get this error:

Microsoft OLE DB Provider for ODBC Drivers (0x80040E21)
Multiple-step OLE DB operation generated errors. Check each OLE DB status value, if available. No work was done.


what is the problem with the code?
way do i get this error?

my code for updating is:



Dim RS
Set RS = Server.CreateObject("ADODB.Recordset")

RS.Open "SELECT * FROM USER_TABLE WHERE ID="&ID , Con, 2, 3

RS.Fields("F_NAME").Value = F_NAME
RS.Fields("L_NAME").Value = L_NAME
RS.Fields("EMAIL").Value = EMAIL
RS.Fields("USER_NAME").Value = USER_NAME
RS.Fields("PASSWORD").Value = PASSWORD
RS.Fields("THE_TYPE").Value = THE_TYPE
RS.Fields("ok").Value = getShow(ok)
RS.Fields("LAST_MODIF").Value = Now()
RS.Fields("USER_MODIF").Value = Session(SESSION_USERID)

RS.Update
RS.Close
Set RS = Nothing

BaldEagle
05-06-2006, 11:47 PM
The error you are getting sometimes is a datatype problem. Null value or empty strings to a field that doesn't except them. There may be other issues rather than this but this would be a good place to start.

BaldEagle

dushy_d
05-07-2006, 12:41 AM
I dont send a null value or empty strings
i am sending values
but despite that
i get the error

when i change the type of the feild to VARCHAR it works!
but when the feild is TEXT it givs me the error

i think that is wher the problem is

i must have the feild to be TEXT and not VARCHAR so i can add unlimited text

what can i do to fix this problem?

BaldEagle
05-07-2006, 01:00 AM
Try some of the suggestions here:

http://www.aspfaq.com/show.asp?id=2288

and see if one of them will address your problem. It says something about not using the update method, instead use a insert statement.

BaldEagle

dushy_d
05-07-2006, 06:22 AM
Whell unfortunately I must use the AddNew/Update methods of ADODB.Recordset

and when i use them i get the error

any way
i found somthing
but i dont understand what it means



In the end I just executed UPDATE and INSERT sql statements instead of using recordsets and these never seem to return errors, although I heard somewhere that using a client side cursor might solve the problem.


can any one tell me what is the numbers for: "client side cursor " ?
my SQL statment is now:



RS.Open "SELECT * FROM USER_TABLE WHERE ID="&ID , Con, 2, 3

Spudhead
05-08-2006, 03:08 PM
I must use the AddNew/Update methods of ADODB.Recordset

Why? :confused: :confused:

They're expensive memory objects, they don't do anything useful [especially] when you're not returning any data, and they make debugging your SQL calls difficult.

At the very least, switch to SQL statements for debugging. You'll probably be able to see at a glance what's wrong with it, and even if you can't, it'll give you a much better starting point.

In any case, a reference to ADO Recordsets and their various enums can be found at: http://www.devguru.com/technologies/ado/8686.asp



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum