Results 1 to 9 of 9

Thread: [RESOLVED] Error when Updating Database

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Jun 2006
    Posts
    83

    Resolved [RESOLVED] Error when Updating Database

    Hi, I'm using:

    VB 6.0
    Microsoft Access 2000 - 9.0

    -----------------------------------------------------------

    I have a form which interacts with my database, the form
    is currently working great at pulling up records, displaying
    information, etc...

    My Problem occurs, whenever I attempt to "edit" or "update"
    a record. If I completely delete the information in a record's field,
    and leave the field blank... I get the following error:

    Run-time error '-2147217887 (80040e21)':

    Multiple-step operation generated errors. Check each status value.


    Is there any way to blank-out / delete the information in a record's field
    without generating an error?

    Thanks!!!

  2. #2
    Addicted Member BestS's Avatar
    Join Date
    Mar 2005
    Posts
    222

    Re: Error when Updating Database

    There are several possible reasons.
    Are you using a recordset that gets data from than one table and then you try to delete with rs.delete method?
    Please paste the line of code that fires the error, we'll solve your problem.
    Using Visual Basic 6.0, access 2000, Visual Studio 2005

    Rate the post that you approve

  3. #3

    Thread Starter
    Lively Member
    Join Date
    Jun 2006
    Posts
    83

    Re: Error when Updating Database

    Thanks for the reply!!!

    Here's more background... I'm using the adodc control on the form, with the Text Boxes tied to the Database Table through the properties section in VB.

    For example, let's say I have a Table in Access with a record where:

    Field1 = 5
    Field2 = 10

    Now, when i select this record in my form... and delete the values in Field1 and Field2 (so now both fields are blank) I get the error.

    VB does let me change the values to a different number & update... just won't let me make the fields BLANK.

    My code is very basic, with the "update" portion looking like this:

    -------------------------------------
    Private Sub cmdSave_Click()

    datTable.Recordset.Update

    End Sub
    -------------------------------------


    When the error pops up, I hit "Debug" and VB highlights the datTable.Recordset.Update line of code.

    Thanks for any advice/help!!!

  4. #4
    Super Moderator si_the_geek's Avatar
    Join Date
    Jul 2002
    Location
    Bristol, UK
    Posts
    41,974

    Re: Error when Updating Database

    I'm using the adodc control
    there is a thread in the Database FAQ's (link below) which explains why that is a bad idea.


    Anyway, on to the problem in this case.. it sounds to me as if you have not set up the database appropriately for your needs.

    As you want to have the fields blank, you have to go into the table design, and ensure that "required" is set to No, and possibly "allow zero length" is set to Yes (for text fields).

    If that doesn't correct it, let us know what data type the fields are.

  5. #5

    Thread Starter
    Lively Member
    Join Date
    Jun 2006
    Posts
    83

    Re: Error when Updating Database

    I'm still getting the error...

    As for my database table, the fields are set-up as:

    Data Type: Number
    Field Size: Single
    Format: General Number

    All numbers entered by the user on the form are between 1-20. (no decimals)

    So, still getting error when attempting to edit an existing record... where any fields with a value are deleted to be BLANK.

    Thanks!

  6. #6
    Super Moderator si_the_geek's Avatar
    Join Date
    Jul 2002
    Location
    Bristol, UK
    Posts
    41,974

    Re: Error when Updating Database

    Ok.. can you make the fields blank (manually) in Access?

  7. #7

    Thread Starter
    Lively Member
    Join Date
    Jun 2006
    Posts
    83

    Re: Error when Updating Database

    Yes... I can make fields blank in Accesss and save the table with no problems.

  8. #8
    Super Moderator si_the_geek's Avatar
    Join Date
    Jul 2002
    Location
    Bristol, UK
    Posts
    41,974

    Re: Error when Updating Database

    In that case it sounds like an issue with the binding to the textboxes, or the Data Control itself. I'm afraid that I have no idea what the problem might be, or how to correct it tho.

  9. #9

    Thread Starter
    Lively Member
    Join Date
    Jun 2006
    Posts
    83

    Re: Error when Updating Database

    Thank you Si for your attention in this matter.

    I'm going to redo the entire form, using code instead of the adodc... and hopefully I'll figure out the issue during the process.

    I'll mark resolved to close this thread...

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