Subject | Re: [IBO] TIBOQuery + TClientDataSet = EDatabaseError |
---|---|
Author | kokok_kokok |
Post date | 2011-12-21T09:21:09Z |
Jason, yes you are right. It works at runtime because in the try-except clause the exception is silenced. However it is very annoying when I need to test the software. The debugger is continuously stopping the test when TIBOQuery is used. I could add this exception to the exception ignore list in the IDE, but then the debug does not catch other EDatabaseError that could appear in other parts of the program and that I would need to debug. In the other side, silencing an exception is not recommended in most of cases.
Is there are a way to avoid this exception? Modifying some sources? overriding some function?
Thank you
Is there are a way to avoid this exception? Modifying some sources? overriding some function?
Thank you
--- In IBObjects@yahoogroups.com, "Support List" <supportlist@...> wrote:
>
> > I have detailed the process from zero:
> >
> >
> > 1) Create a new database suing Firebird 2.0 or 2.5:
> >
> > CREATE TABLE ORDERS (
> > ORDERID INTEGER NOT NULL,
> > NAME VARCHAR(10)
> > );
> > ALTER TABLE ORDERS ADD CONSTRAINT PK_ORDERS PRIMARY KEY (ORDERID);
> >
> >
> > 2) Create a empty project in Builder C++ (or Delphi). In a form, insert
> > one TIBODatabase, TDataSetProvider, one TClientDataSet, and
> > one TIBOQuery.
> >
> >
> > 3) Enter the following properties of IBODatabase1:
> >
> > Password
> > Path
> > User
> > Then put Active property to true.
> >
> >
> > 4) Add a button and add the following source in the click event handler:
> >
> >
> > void __fastcall TForm1::Button1Click(TObject *Sender)
> > {
> > DataSetProvider1->DataSet=IBOQuery1;
> > ClientDataSet1->SetProvider(DataSetProvider1);
> > IBOQuery1->SQL->Text="SELECT COUNT(*) AS COUNTER FROM ORDERS";
> > ClientDataSet1->Open();
> > }
> >
> > 5) Run the project and click the button.
> >
> >
> >
> > It generates a "EDatabaseError" exception, with "Field OrderId not found".
> > Note that OrderId is not in the SQL statement.
> >
> > How can I avoid it?
>
> I see the issue you are talking about but apparently this is just an
> annoyance because apparently the internals expect that there could be an
> exception. You should notice that at runtime there is no error at all
> because in the try-except clause the exception is silenced.
>
> I'm not exactly sure what I can do about it.
>
> Perhaps you can add this to your exception ignore list in the IDE so that it
> won't disrupt your testing?
>
> Jason
>