Results 1 to 2 of 2

Thread: Error 3219?

  1. #1
    Join Date
    May 2003
    Location
    UK
    Posts
    28

    Angry Unanswered: Error 3219?

    Hi

    Can anyone suggest a reason for geting this error

    The error occurs when closing an adodb recordset and it generated the error '3219' 'Operation is not allowed in this context.'

    In MSKB this no relates to opening record sets, one other post in this forum talks of deleting records (no deletions take place in this instance)

    The code in question is as follows:

    rsAgStatus.Open "TBL_AGENT_REC_STATUS", cnn, adOpenKeyset, adLockOptimistic, adCmdTable
    strErrMsg = "Updating Agent Rec Stat"

    Do Until rsAgResyncs.EOF

    With rsAgStatus
    .AddNew
    ![BILLING_MONTH] = dtBillMonth
    ![SITE_ID] = rsAgResyncs![SITE_ID]
    ![AGENCY_NAME] = rsAgResyncs![AGENCY_NAME]
    ![RSD_KEY] = Format(rsAgResyncs![RESYNC_DATE], "YYYYMMDD")
    ![REC_TYPE] = "RESYNC"
    ![FIRST_PROC] = True
    ![FIRST_PROC_DATE] = Format(Date, "dd/mm/yyyy")
    ![REC_AGNT_UPDATE_DATE] = Format(Date, "dd/mm/yyyy")
    ![REC_AGNT_UPDATE_TIME] = Format(Now, "hh:nn:ss")
    ![REC_AGNT_UPDATE_USER] = CurrentUser()
    .Update
    End With

    rsAgResyncs.MoveNext
    Loop
    End If

    ExitCode:
    If rsAgStatus.State = adStateOpen Then rsAgStatus.Close
    If rsAgResyncs.State = adStateOpen Then rsAgResyncs.Close
    Exit Function

  2. #2
    Join Date
    Oct 2003
    Location
    US
    Posts
    343

    Re: Error 3219?

    Before you open your record set. Place this code.
    rsAgStatus.CursorLocation = adUseClient

    Also try using adOpenForwardOnly instead of adOpenKeyset. This is faster.

    Hope this will help.


    Originally posted by Mara
    Hi

    Can anyone suggest a reason for geting this error

    The error occurs when closing an adodb recordset and it generated the error '3219' 'Operation is not allowed in this context.'

    In MSKB this no relates to opening record sets, one other post in this forum talks of deleting records (no deletions take place in this instance)

    The code in question is as follows:

    rsAgStatus.Open "TBL_AGENT_REC_STATUS", cnn, adOpenKeyset, adLockOptimistic, adCmdTable
    strErrMsg = "Updating Agent Rec Stat"

    Do Until rsAgResyncs.EOF

    With rsAgStatus
    .AddNew
    ![BILLING_MONTH] = dtBillMonth
    ![SITE_ID] = rsAgResyncs![SITE_ID]
    ![AGENCY_NAME] = rsAgResyncs![AGENCY_NAME]
    ![RSD_KEY] = Format(rsAgResyncs![RESYNC_DATE], "YYYYMMDD")
    ![REC_TYPE] = "RESYNC"
    ![FIRST_PROC] = True
    ![FIRST_PROC_DATE] = Format(Date, "dd/mm/yyyy")
    ![REC_AGNT_UPDATE_DATE] = Format(Date, "dd/mm/yyyy")
    ![REC_AGNT_UPDATE_TIME] = Format(Now, "hh:nn:ss")
    ![REC_AGNT_UPDATE_USER] = CurrentUser()
    .Update
    End With

    rsAgResyncs.MoveNext
    Loop
    End If

    ExitCode:
    If rsAgStatus.State = adStateOpen Then rsAgStatus.Close
    If rsAgResyncs.State = adStateOpen Then rsAgResyncs.Close
    Exit Function

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •