MS Access error

Discussion in 'Databases' started by PGScannell, May 4, 2007.

Thread Status:
Threads that have been inactive for 5 years or longer are closed to further replies. Please start a new thread.
  1. I get the following error when I attempt to modify some fields in my database:

    Key column information is insufficient or incorrect. Too many rows were affected by update.

    I have checked everything and there is absolutely nothing with the code! (all programmers think that way, don't they?)

    Here's the code loop. The failure occurs on the objResps(0).update line:
    ======================
    For x = DirectorGRAND_KNIG to DirectorOUTSIDE_G2
    strField1 = "MEMBNO" & x
    strField2 = "WIFE" & x
    strField3 = "EMAIL" & x
    strMembNo = stringTest ( Request.Form ( strField1 ) )
    If not IsBlank ( strMembNo ) then
    strWife = stringTest ( Request.Form ( strField2 ) )
    strEmail = stringTest ( Request.Form ( strField3 ) )
    if not isBlank ( strWife ) or not isBlank ( strEmail ) then
    Query = "select wife, email from members where membno = '" & strMembNo & "'"
    UPDATE_query Query, 0
    If not objResps(0).eof then
    response.write Query & " " & objResps(0).recordCount & " wife " & strWife & " email " & strEmail & ""
    flagUpdated = false
    if not isBlank ( strWife ) then
    response.write ( "update wife" )
    objResps (0) ( "WIFE" ) = strWife
    flagUpdated = true
    end if
    if not isBlank ( strEmail ) then
    response.write ( "update email" )
    objResps (0) ( "EMAIL" ) = strEmail
    flagUpdated = true
    end if
    if flagUpdated = true then objResps (0).Update <--- LINE 82 MENTIONED IN THE ERROR MSG...
    end If
    objResps (0).Close
    objConns (0).Close
    end If
    end If
    next



    =======================

    Here's the runtime display. You will notice that there is already a record that has a wife but no email as well as a line with both. There is one record that has neither. The exclusion of that record was my latest attempt to diagnose the problem. (if not isBlank ( strWife ) or not isBlank ( strEmail ) then line of code was added later. I had the same exact problem with the same record before ) Note that the 1 is the recordcount of my update query. I wanted to see if I was attempting to edit more that one record:

    select wife, email from members where membno = '3740188' 1 wife Jeanne email
    update wife
    select wife, email from members where membno = '3124199' 1 wife Marge email [email protected]
    update wife
    update email
    select wife, email from members where membno = '1298084' 1 wife Laura email
    update wife



    Microsoft Cursor Engine error '80004005'


    Key column information is insufficient or incorrect. Too many rows were affected by update.


    /updateCouncilOfficers.asp, line 82


    Thanks in advance,


    Jerry
     
Thread Status:
Threads that have been inactive for 5 years or longer are closed to further replies. Please start a new thread.

Share This Page