Delphi7/ADO/SQL Server 2000 TDBGrid problem

From: Robert Carrington (rcarrington_at_ice-sys.co.uk)
Date: 06/16/04

  • Next message: Doug Maurer: "InsertRecord function"
    Date: Wed, 16 Jun 2004 14:37:15 +0100
    
    

    I have 1 TDBGrid component and multiple TADOQuery objects that can be
    connected to it.

    Depending on where grid is accessed from a different query is connected to
    it. These queries are always open in the background regardless.

    The problem is that sometimes when trying to select a row in the grid it
    actually selects a completely different row. 2 indicators are shown on the
    indicator column as well. These can only be got rid of by selecting the row
    that was initially selected.

    This usually happens after the TDBGrid.DataSource.DataSet has been swapped
    several times and then returns to a dataset that has been open in the past.

    Is this a bug that anyone else has come across? I agree that it is not a
    particularly good method of doing things but it is still doing something
    that is apparently allowed by Delphi and it is not throwing any errors.
    Also there should be no possible way for a row other than the one you click
    on to be selected. I would be interested if anyone else has/is able to
    replicate this as I have not seen anything about this on the net.

    I have tried various methods of refreshing/repainting and cannot get
    anything to work.

    NOTE:
    1. I cannot just rewrite the code as it would have too large an impact on
    the rest of the program.
    2. I cannot just close the query and reopen it as I wish to retain the
    position in the query. ).


  • Next message: Doug Maurer: "InsertRecord function"

    Relevant Pages

    • Re: Delphi7/ADO/SQL Server 2000 TDBGrid problem
      ... I use this approach to edit what I call simple system tables. ... is that I do not edit data in the grid. ... These can only be got rid of by selecting the ... I cannot just close the query and reopen it as I wish to retain the ...
      (borland.public.delphi.database.ado)
    • RE: running sum from a subform
      ... Thanks you for your help Sprinks. ... I was able to build a query that did the calcuations. ... > Order), drag that table's primary key to the grid, ... > If, in addition, you have selection criteria, such as selecting records from ...
      (microsoft.public.access.forms)
    • RE: running sum from a subform
      ... Begin a new query, selecting the table or tables that contain the fields of ... Totals View. ... Order), drag that table's primary key to the grid, ... If, in addition, you have selection criteria, such as selecting records from ...
      (microsoft.public.access.forms)
    • Re: update query: still having problems
      ... bring the workstatus field in the grid and, at the criteria line, write: ... UPDATE Department INNER JOIN Sheet1 ON Department.employeeID = ... What I want to do is press a button that will run the query and update the ...
      (microsoft.public.access.queries)
    • RE: Change address fields in Table using Unbound Combo Box
      ... I am selecting a new address for the current voter. ... "FindDupsVIT" Query. ... Update the controls in the form based on the values in the columns of the ... Don't confuse the combo's Bound Column property with it's Control ...
      (microsoft.public.access.forms)