Results 1 to 6 of 6

Thread: ADO Recordset Update failure

  1. #1

    Thread Starter
    Member
    Join Date
    Aug 1999
    Location
    Ohio
    Posts
    59

    Post

    When executing the following code for the first time I get the error -2147217887 (80040e21).

    Code:
    rsBaseline("USGCalcedHours") = rsBaseline("USGCalcedHours") + _
    (((nDuration * rsWeight) / 100) * rsBaseline("USGResourcePct")) / 100

    rsBaseline.Update


    I can "F8" past this error in the VB Environment and the rest of the program runs fine. The data type is numeric and the above code returns a 0 but it will not update. I return 0's in other parts of the code and it updates.

    The database is Access97 and I'm using VB6.

    Any ideas on what would cause this only for the first time a try to commit an update?

    Thanks

  2. #2
    Lively Member
    Join Date
    Mar 1999
    Posts
    93

    Post

    Check AloowZeroLength property of the database field

  3. #3

    Thread Starter
    Member
    Join Date
    Aug 1999
    Location
    Ohio
    Posts
    59

    Post

    All of my text fields have AllowZeroLength = Yes. The other fields are numeric and the Required field equals No.

    Any other suggestions?

  4. #4
    Guru Aaron Young's Avatar
    Join Date
    Jun 1999
    Location
    Red Wing, MN, USA
    Posts
    2,177

    Post

    Did you get a Message to go with the Error Number? Are any of the Calculation Variables Null? What is rsWeight?

    ------------------
    Aaron Young
    Analyst Programmer
    [email protected]
    [email protected]

  5. #5
    New Member
    Join Date
    Oct 1999
    Location
    St. Louis, MO, USA
    Posts
    8

    Post

    rsWeight looks funny to me too. Should it have been rsBaseline("Weight")?

    ------------------
    <b>W</b>eb<b>M</b>an

  6. #6

    Thread Starter
    Member
    Join Date
    Aug 1999
    Location
    Ohio
    Posts
    59

    Post

    rsWeight is actually a numeric long.
    I'm new to VB and I now know I didn't use the proper naming convention.

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