Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 6 of 6
  1. #1
    New to the CF scene
    Join Date
    May 2006
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    ASP - mySql TEXT field type problem

    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:

    Code:
    		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

  • #2
    Regular Coder
    Join Date
    Apr 2005
    Location
    Lisbon, CT
    Posts
    339
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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

  • #3
    New to the CF scene
    Join Date
    May 2006
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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?

  • #4
    Regular Coder
    Join Date
    Apr 2005
    Location
    Lisbon, CT
    Posts
    339
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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

  • #5
    New to the CF scene
    Join Date
    May 2006
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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

    Code:
    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:

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

  • #6
    Senior Coder Spudhead's Avatar
    Join Date
    Jun 2002
    Location
    London, UK
    Posts
    1,856
    Thanks
    8
    Thanked 110 Times in 109 Posts
    Quote Originally Posted by dushy_d
    I must use the AddNew/Update methods of ADODB.Recordset
    Why?

    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


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •