CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 12 of 12

Thread: Update error

  1. #1
    Join Date
    Dec 1999
    Location
    Europe
    Posts
    27

    Update error

    When I try to update a record I get the message:
    "[Microsoft][ODBC Microsoft Access Driver] The search key was not found in any record". I'm using ADO and this message apears only when I modify a memo field which contains 500 chars.
    What could be the problem? Please help me with some sugestions. Thanks


  2. #2
    Join Date
    Dec 1999
    Location
    Malaysia
    Posts
    56

    Re: Update error

    Not sure about this, but it is best to find out the limitation of Access on the number of characters allowed for a field. As I recall, I think for text fields (the text datatypes) the limit is 255 characters... so check it out with Access first!
    Hope this points you in the right direction for debugging purposes...


    ____________________________________
    The VB Bugs in my Life...

  3. #3
    Join Date
    Dec 1999
    Location
    Europe
    Posts
    27

    Re: Update error

    Thanks, but it's not that. I have a memo field which can hold up to 32K of char. The corresponding field in the form is a multiline TextBox.
    I'm really blocked now.



  4. #4
    Guest

    Re: Update error

    try cheking whether the field names are correct,table name is correct and whether ur odbc is installed properly..



  5. #5
    Join Date
    Dec 1999
    Location
    Slovakia
    Posts
    26

    Re: Update error

    Try to use GetChunk/AppendChunk method. They are designed for work with MEMO fields.

    [ufo]

  6. #6
    Join Date
    Dec 1999
    Location
    Europe
    Posts
    27

    Re: Update error

    That's a good idea. I'll try it.
    Thanx.


  7. #7
    Join Date
    Dec 1999
    Location
    Europe
    Posts
    27

    Re: Update error

    It didn't work. I receive the same message. Any other idea?


  8. #8
    Join Date
    Dec 1999
    Location
    Slovakia
    Posts
    26

    Re: Update error

    What about primary key in your recordset ? Without primary key you can't update through recordset. Try to open recordset with column which is in background table as primary key.



    [ufo]

  9. #9
    Join Date
    Dec 1999
    Location
    Europe
    Posts
    27

    Re: Update error

    I have a primary key. An AutoNumber. If the number of characters within the memo field in not larger than ?? (I didn't find out the limit), the update works OK. I tryed to update a record when the memo field had 1000 chars and it worked. But if the memo field has 2000 char and I erase one char even, the update doesn't work. Also I don't have the problem when I add a new record. Even if the memo field has 15000 chars.
    I hope is not a bug in the driver. I searched for the error message at microsoft.com and I didn't find it.
    I'm desperate.



  10. #10
    Join Date
    Dec 1999
    Location
    Europe
    Posts
    27

    Re: Update error

    All of that is correct. The update works OK if the fields has, let's say, 100 characters.
    Thanx anyway. Any other idea?


  11. #11
    Join Date
    Dec 1999
    Location
    Slovakia
    Posts
    26

    Re: Update error

    OK, send me some more information and I will see what to do.

    1. connection string ?
    2. version of MDAC on your machine ?

    However, I can ask some people from private beta newsgroup regarding this and if it's bug I will have patch or something.


    [ufo]

  12. #12
    Join Date
    Dec 1999
    Location
    Europe
    Posts
    27

    Re: Update error

    lConnection.CursorLocation = adUseClient
    lConnection.ConnectionString=PROVIDER=MSDASQL;dsn=find2;uid=;pwd=;
    adoPrimaryRS.Open sqlString, lConnection,
    adOpenDynamic, adLockPessimistic

    I use Microsoft ActiveX Data Objects 2.1 Library.

    On the form I have a multiline TextBox with the DataField property set to my database memo field.

    Thank you again for your help.


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