odd D8/VCL.NET/IDE related problem - system.nullreferenceexception in Borland.VCL.DBTables

From: Robert Toeplitz (bobtoeplitz_at_freemail.hu)
Date: 05/07/04

  • Next message: ron Tuijnman: "Conversion D6 --> D7, Listactns"
    Date: Fri, 7 May 2004 18:58:48 +0200
    
    

    Dear Gentlemen,

        migrating from a Delphi 6 VCL application to a VCL.NET application I
    bumped into a weird error, which was kind of hard to trace back and found it
    impossible to resolve so hereby I turn to you all.

    After some debugging and tinkering I could finally break down the problem to
    the following scenario. This scenario mimicks a minimal subset of my future
    VCL.NET migrated application's behaviour:

    - Create a new VCL.NET forms application.
    - On the default Form1 lay a TDatabase component and two TButton components.
    For this example let's name them Database1, OpenButton and CloseButton. The
    buttons' onclick events should do no more than <Database1.Open> and
    <Database1.Close> respectively. Database1 should point to a living database
    source, altho the underlying database-type is totally irrelevant (have
    tested with local postgresql, remote postgresql, dbase and excel
    datasource -- all produced the same error).
    - Put a TDatasource and a TTable component on the form too. TDatasource
    pointing to TTable and TTable pointing to Database1. Pick any of your
    database's tables for the TTable.
    - Given just these components I've described, compile and run the
    application. Everything works just fine. Clicking the buttons in any order,
    closing the form at any time and doing these activities in any combination
    should not bring up any error.
    - Now comes the oddness. What makes things all messed up is putting a
    TDBEdit component on the form. It doesn't even have to point the
    TDatasource! Compiling and running the application is still OK but if I open
    the database and close the form without explicitly choosing to close the
    database before, it creates a System.NullReferenceException. I found out
    that the exception is thrown in Borland.VCL.DBTables' finalize section when
    calling FreeTimer. The guilty party is FreeTimer's <if Assigned(DBScreen)
    then DBScreen.Cursor := dcrDefault;> line.

    Agan. Opening the Form then opening the database with OpenButton then
    closing it with CloseButton and then closing the form still works fine. But
    even putting Database1.Close; in the form's onClose or onCloseQuery event
    methods won't even help.

    Even more weird is that removing the TDBEdit from the form leaves things as
    messed up as they were.

    The nullpointerexception is not thrown when doing the same actions outside
    the IDE, but during development it is kind of annoying because any time I'm
    not quick enough to stop execution before the exception is thrown, the IDE
    start's throwing arbitrary exceptions at different times which leads to the
    necessity of restarting it.

    I've tested this behaviour on 2 different computers (one of them had nothing
    else installed just delphi 8 and it's prerequisites) each with Delphi 8
    update #2 and on a third one, which didn't have the updates just Delphi 8.
    All three tests represented the exact same bug.

    Has anybody bumped into the same problem or anything that could be related
    to it? Does anybody have a fix or workaround for it?
    I couldn't find any.

    Thanks in advance,
    Robert Toeplitz,
    Hungary.


  • Next message: ron Tuijnman: "Conversion D6 --> D7, Listactns"

    Relevant Pages

    • Re: Delphi Jobs
      ... I am a Delphi database programmer. ... Source Safe and Source Off Site on the server side and client side. ... design several pieces for the interactive website. ...
      (comp.lang.pascal.delphi.misc)
    • not included in the present interval
      ... I'm using delphi 7 with OLEDB provider to connect to SQL Server ... database and i use ADO library to manage the database operation ... I wrote this query: ... "occasionally" an exception is raised ...
      (borland.public.delphi.database.ado)
    • odd D8/VCL.NET/IDE related problem - system.nullreferenceexception in Borland.VCL.DBTables
      ... Database1 should point to a living database ... The nullpointerexception is not thrown when doing the same actions outside ... not quick enough to stop execution before the exception is thrown, ... else installed just delphi 8 and it's prerequisites) each with Delphi 8 ...
      (alt.comp.lang.borland-delphi)
    • Re: Embarcaderos Director of Products Blog
      ... What indications were there that it was difficult to sell, ... but Delphi has ALWAYS been about database development. ... All of which DO make perfect sense and could be seen as having a home at ...
      (borland.public.delphi.non-technical)
    • Software specifications
      ... I have been frustrated in this project because my software and hardware is ... another programmer who has been my mentor in Delphi, ... me when it will be ready, as they are struggling with old MSDOS software ... could do the entire database project myself, ...
      (comp.lang.pascal.delphi.misc)