CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 7 of 7
  1. #1
    Join Date
    Feb 2003
    Posts
    417

    Strange error in SQL statement

    I have a Memo type field in MS Access which is represented in the front end by a Multiline textbox of max length 4000. When I save a new record with 4000 chars in this field, I do not get any error. It works fine. However, when I write an update query for this field with the same data, I get an error saying:

    Code:
    Run-time error '-2147467259 (80004005)':
    
    Could not save; currently locked by another user.
    Please see picture attached.

    I get this error in the line I execute the SQL statement. If I enter data less than 4000, which is the max length of the textbox I get no error. I also get no error when I add a new record with 4000 chars. If I update a record with data less than 4000 chars for this field, I get no error.

    Anyone faced this problem? Please help me.
    Attached Files Attached Files

  2. #2
    Join Date
    Jul 2003
    Location
    I'm Here!
    Posts
    31
    You need to use Text-16 for your field's datatype.

    Don't let the 16 scare you, it's capable of 4000 as I am currently using it.

    That is assuming you are using SQL Server.

  3. #3
    Join Date
    Feb 2003
    Posts
    417
    I am using MS Access.

  4. #4
    Join Date
    Jul 2003
    Location
    I'm Here!
    Posts
    31
    What is your field's datatype?

  5. #5
    Join Date
    Feb 2003
    Posts
    417
    Memo.

  6. #6
    Join Date
    Jul 2003
    Location
    I'm Here!
    Posts
    31
    I don't know if this may be the problem but:

    Memo fields allow up to 65,535 characters.
    If you are manipulating the data through DAO and only text and numbers are being stored in it, then the size of the Memo field is limited by the size of the database.

    Sorry for the last question since you answered it from the beginning and I wasn't pay attention.

    I have run into the same problem with SQL Server and my explanation is how I was able to overcome it.

    Maybe somebody else has a better answer. Good luck!

  7. #7
    Join Date
    Apr 2002
    Location
    Melbourne, Victoria, Australia
    Posts
    1,792
    I don't think you can update a memo field - I think you have to delete it and re-write the record. (but I can't remember where I read it - probably on MSDN)
    Be nice to Harley riders...

Posting Permissions

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





Click Here to Expand Forum to Full Width

Featured