TData v8 Refresh Problem

ActiveX

ActiveX controls

TData v8 Refresh Problem

  • rated by 0 users
  • This post has 2 Replies |
  • 1 Follower
  • This is a multi-part message in MIME format.

    ---=_vger543c69338
    Content-Type: text/plain
    Content-Transfer-Encoding: 7bit


    Hello,

    I'm having a weird problem refreshing a TData (v8) data control. Here's the situation:

    1. I have a tdbGrid (v8) connecting to a TData. The TData is connected to an Access database.
    2. I click on a row in the grid, highlighting it. I then click on a command button.
    3. In the command button's click event, I then delete the indicated row from the database. However, I don't delete it directly through the recordset attached to the TData. Instead, the row is deleted directly from the underlying database (there are reasons it needs to be done this way).
    4. The code then requeries the sourcerecordset of the TData and then refreshes the TData itself:

    adoTest.SourceRecordset.Requery
    adoTest.Refresh

    5. However, the deleted row still appears in the tdbGrid. Stepping through the code and checking the RecordCount of the TData shows that it hasn't updated itself to reflect the deleted record.
    6. Adding to my confusion is that if I display another form **in modal mode** and then refresh the TData upon closure of this other form, the TData refreshes itself appropriately. This only happens if the new form is a modal form.

    I'm very confused. If anyone can tell me what I'm doing wrong, I'd be very grateful. Why does running a modal form suddenly make the TData's refresh work???

    I've attached a stripped down project that contains just enough code to illustrate the problem.

    Thanks in advance for any suggestions.

    Cheers,

    Eugene.
    ---=_vger543c69338

    Click here to view the original newsgroup article (read only).

  • I have the EXACT same problem, was this issue ever addressed?

  • I did exactly as the doc says...

    reflected in SourceRecordset. To ensure that TData shows the latest state of the database, use Refresh in conjunction with the ADO Requery method:

    TData1.SourceRecordset.Requery  <--- When this fires off now..
    I get {-2147217908 Description: Command text was not set for the ...)

    TData1.Refresh True

    The grid still has both records in it.

Page 1 of 1 (3 items)