Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Error 3856 cannot update

Status
Not open for further replies.

formerTexan

Programmer
Apr 10, 2004
504
0
0
US
Greetings,

I hope someone can offer suggestions as to why the following error is raised(aside from the obvious: running on a non-2010 version)?

Error 3856: The Microsoft Office Access database cannot update the data in tblNextNumber. The minimum required version to update the data is 14.0.0000.0000.

An accdb database was created in 2010 with a 2007 default format and isn't using any 2010 functionality. No protests were raised when saving back to a 2003 version and I can't duplicate the error using A2010. However users with the accdb version running on an Access 2007 installation encountered the error.

The table (tblnextNumber) is a standard, non-version specific table. The relevant function is below and it is called from a from BeforeUpdate event

Code:
Public Function pfNextNumber() As Long
Const LOCK_RETRY_MAX = 10
Const LOCK_ERRORS = "Record can't be saved at this time.  Do you want to try again?"

Dim db As DAO.Database
Dim rs As DAO.Recordset
Dim lngOld As Long
Dim lngNew As Long
Dim iLock As Integer
On Error GoTo pfNextNumber_Err

    Set db = CurrentDb
    iLock = 0
        DoCmd.SetWarnings False
' another user could come in, make concurrent changes and bugger up the system
' therefore to preclude conflicts table access is denied to other users while recordset is open
        Set rs = db.OpenRecordset("qryNextNumber", dbDenyRead)
            With rs
                If Not .BOF And Not .EOF Then
                    lngOld = !NextNumber
                    lngNew = lngOld + 1
                    .Edit
                    !NextNumber = lngNew
                    .Update
                    pfNextNumber = lngNew
                End If
            End With

        DoCmd.SetWarnings True
pfNextNumber_Exit:
        rs.Close
        db.Close
        Set rs = Nothing
        Set db = Nothing
    Exit Function
pfNextNumber_Failed: '
' -333 will designate a failed function operation
' and must be handled outside this function by terminating the addition of a new record
    pfNextNumber = -333
        
GoTo pfNextNumber_Exit:

pfNextNumber_Err:
    Select Case Err                             ' if data has been changed, refresh the recordset and try again.
        Case 3197: rs.Requery
            Resume
        Case 3167:                              ' if record is deleted
            MsgBox "Operation has failed! Notify administrator that autonumber function is broke.", vbOKOnly
            Resume pfNextNumber_Failed
        Case 3260:                              ' another user has locked the table
            iLock = iLock + 1
                If iLock < LOCK_RETRY_MAX Then  ' if still less than the allotted attempts, try again
                    Resume
                Else                            ' we are over the limit for attempts at accessing the table
                    MsgBox "LOCK_ERRORS! This record remains locked by another user and is unavailable", vbOKOnly
                    Resume pfNextNumber_Failed
                End If
        Case Else
            MsgBox "Error " & Err & ": " & Error
            Resume pfNextNumber_Failed
    End Select

Thanks much
formertexan
 
This problem has seemingly been resolved with thanks to posts at


I'll summarize what appears to be happening.

When developing in A2010 with the default version set to A2007, using any A2010 specific functionality seemingly contaminates the A2007 version. For example: adding a data macro may result in a A2007 incompatible database even though the data macro has been deleted. Note that this behavior may not appear consistent.

The solution is to clean out all of the A2010 specific functionality, then create a new A2007 version database and import all the objects. Hopefully you will now have an uncontaminated A2007 version.

Cheers,
formertexan
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top