locked
Current Record does not support updating RRS feed

  • Question

  • I get the error "Current Record does not support updating...." when executing the following code, but only from one of my customers and after the exact same code has worked 59 times.  Also, if I bring their data base to my computer and run the same function the code is successful over 200 times and no error is reported.  Their computer is a Windows XP system. It seems that some component on their system is bad, how can I find out which component is causing the problem and fix it without messing up other applications on their computer?

    Dim accdbStr As String = oGlobal.ConnectionString
    '
    Dim RSetConn As ADODB.Connection
    '
    RSetConn = New ADODB.Connection
    RSetConn.Mode = ADODB.ConnectModeEnum.adModeReadWrite
    '
    RSetConn.Open(accdbStr)
    '
    Dim Result As Object = RSetConn.Execute("SELECT MAX(TID) FROM Trans")
    Dim NewTID As Integer = Result(0).Value + 1
    '
    Dim RSet As New ADODB.Recordset
     'RSet.CursorLocation = ADODB.CursorLocationEnum.adUseClient
     'RSet.CursorType = ADODB.CursorTypeEnum.adOpenDynamic
     'RSet.LockType = ADODB.LockTypeEnum.adLockOptimistic
    RSet.Open("Trans", RSetConn, ADODB.CursorTypeEnum.adOpenDynamic, ADODB.LockTypeEnum.adLockOptimistic)
     '
    RSet.AddNew()
    RSet("SchID").Value = 1
    RSet("TID").Value = NewTID
    RSet.Update
    RSet.Close()
    RSetConn.Close()


    Dale Roedger

    • Moved by Min Zhu Tuesday, January 8, 2013 7:20 AM (From:ADO.NET DataSet)
    Friday, December 28, 2012 3:37 PM

Answers

  • I hope the problem was in RSet.Open.Please check the example in the following URL and update your code based on that

    http://support.microsoft.com/kb/824256?wa=wsignin1.0


    With Thanks and Regards
    Sambath Raj.C
    click "Proposed As Answer by" if this post solves your problem or "Vote As Helpful" if a post has been useful to you
    Happy Programming!

    • Marked as answer by DaleRoedger Tuesday, January 8, 2013 2:23 PM
    Friday, December 28, 2012 4:52 PM

All replies

  • I hope the problem was in RSet.Open.Please check the example in the following URL and update your code based on that

    http://support.microsoft.com/kb/824256?wa=wsignin1.0


    With Thanks and Regards
    Sambath Raj.C
    click "Proposed As Answer by" if this post solves your problem or "Vote As Helpful" if a post has been useful to you
    Happy Programming!

    • Marked as answer by DaleRoedger Tuesday, January 8, 2013 2:23 PM
    Friday, December 28, 2012 4:52 PM
  • Yes, the error was on the RSet.Open statement.

    My connection string uses Provider=Microsoft.ACE.OLEDB.12.0; would I be able to use "Provider=Microsoft.Jet.OLEDB.4.0; instead?  I am only using the Access data base file to hold data.

    Would this make the application run any faster in a networked installation?


    Dale Roedger

    Friday, December 28, 2012 6:29 PM
  • Dale,

    The recordset has nothing to do with Ado.Net DataSets which is the topic of this forum.

    I assume your code is VBA so try the forum of that for your question. 

    http://social.msdn.microsoft.com/Forums/en-US/isvvba

    If it is VB6 then don't tell that because that version is off topic in all Microsoft forums.


    Success
    Cor

    Tuesday, January 1, 2013 3:47 PM