Menu

Delete Objects

2004-08-30
2004-08-31
  • Nobody/Anonymous

    HI,
    How I can eliminate of my cursor an object. I erase  an object and want that it is reflected in the cursor, I don't to return to consult the DataBase

    ***************
            Dim rc As CRetrieveCriteria
            Dim t As New TipoPorte
            Dim cursor As CCursor
            t = New TipoPorte
            rc = New CRetrieveCriteria
            rc.ReturnFullObjects = True
            cursor = rc.perform(t)

    .........
    ..........

    tp.Delete() ' Object of the cursor

    The cursor has the same objects. When your delete objects, delete of the cache or not.

    Saludos

    Victor (Madrid - Espaa)

     
    • Richard Banks

      Richard Banks - 2004-08-31

      Hi Victor,

      All persistent object operations (retrieve, save, delete) work directly against objects in the database.

      Objects instantiated via a retrieve criteria are disconnected from the originating recordset and will update the database directly when save and delete are called, not the recordset.

      A recordset in a cursor is a readonly snapshot of the database at that point in time.  The only way to update the recordset is to do it manually or call perform() again.

      Out of curiosity, what are you doing that requires you to update the recordset after deletion?

      - Richard.

       
    • Nobody/Anonymous

      I have a cursor of objects in memory and visualize them in a datagrid, when I erase an object want that it is reflected in the datagrid, but I do not want to return to recover of the base of information. They are many records in the datagrid and it is not ideal to recover again all the records.

       
    • Richard Banks

      Richard Banks - 2004-08-31

      Hi Victor,

      I don't have a simple/quick answer for you on this one.  Could you post a request (RFE) so that the job is on my to-do list and I will see what I can do to solve the problem.

      Thanks.

       

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.