Subject Re: [IBO] Empty error/exception message in TIBODataset
Author Frederic Bell
--- In IBObjects@yahoogroups.com, Ramil <khabibr@...> wrote:
>
> Hi Hasan,
>
> I have tested your application.
>
> I have used IBO version 4.6Bc with last hotfix and not encountered
> this problem.
> It seems the bug is peculiarity of 4.6Bc version only.
> I strongly recommend rollback to the earlier IBO version or wait
> for new release from Jason.
> It will issue soon.
>
>
> --
> Best regards,
> Ramil khabibr@...
>
>
> >
> >
> >
> >
> >
> > Hi Jason,
> > Thanks again for your reply.
> > Here is a small application with only one form (unit1.pas) using a
> > basic functionality of TIBOQuery.
> >
> > To reproduce the error:
> > - Just run the app, and try connect to any database in your system by
> > clicking connect button (it will prompt you the details since
> > loginprompt is true)
> > - type a wrong sql text in the memo, such as
> > "select * from wrong_table_name;"
> > - click run button
> >
> > below are the source code in text mode:
> >
> > regards,
> > Hasan
> >
> > //////////////////// begin of unit1.pas ///////////////
> > unit Unit1;
> >
> > interface
> >
> > uses
> > Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms,
> > Dialogs,
> > StdCtrls, ExtCtrls, Db, DBCtrls, Grids, DBGrids,
> > IB_Components, IBODataset;
> >
> > type
> > TForm1 = class(TForm)
> > Memo1: TMemo;
> > Panel1: TPanel;
> > btnConnect: TButton;
> > btnRun: TButton;
> > DBNavigator1: TDBNavigator;
> > DBGrid1: TDBGrid;
> > Con1: TIB_Connection;
> > Trans1: TIB_Transaction;
> > Qry1: TIBOQuery;
> > DataSource1: TDataSource;
> > procedure btnConnectClick(Sender: TObject);
> > procedure Con1AfterConnect(Sender: TIB_Connection);
> > procedure Con1AfterDisconnect(Sender: TIB_Connection);
> > procedure btnRunClick(Sender: TObject);
> > private
> > { Private declarations }
> > public
> > { Public declarations }
> > end;
> >
> > var
> > Form1: TForm1;
> >
> > implementation
> >
> > {$R *.DFM}
> >
> > procedure TForm1.btnConnectClick(Sender: TObject);
> > begin
> > Con1.Connected:= not Con1.Connected;
> > end;
> >
> > procedure TForm1.Con1AfterConnect(Sender: TIB_Connection);
> > begin
> > Caption:= 'Connected to [' + Con1.Database + '] as ' + Con1.Username;
> > end;
> >
> > procedure TForm1.Con1AfterDisconnect(Sender: TIB_Connection);
> > begin
> > Caption:= 'Not connected';
> > end;
> >
> > procedure TForm1.btnRunClick(Sender: TObject);
> > begin
> > if not Qry1.Active then Qry1.SQL.assign(Memo1.Lines);
> > case Qry1.IsSelectSQL of
> > True: Qry1.Active:= not Qry1.Active;
> > False: Qry1.ExecSQL;
> > end;
> > end;
> >
> > end.
> > //////////////////// end of unit1.pas ///////////////
> >
> > //////////////////// begin of unit1.dfm ///////////////
> > object Form1: TForm1
> > Left = 199
> > Top = 134
> > Width = 557
> > Height = 381
> > Caption = 'Not connected'
> > Color = clBtnFace
> > Font.Charset = ANSI_CHARSET
> > Font.Color = clWindowText
> > Font.Height = -12
> > Font.Name = 'Verdana'
> > Font.Style = []
> > OldCreateOrder = False
> > PixelsPerInch = 96
> > TextHeight = 14
> > object Memo1: TMemo
> > Left = 0
> > Top = 0
> > Width = 549
> > Height = 115
> > Align = alTop
> > Lines.Strings = (
> > 'select * from wrong_table_name;')
> > TabOrder = 0
> > end
> > object Panel1: TPanel
> > Left = 0
> > Top = 115
> > Width = 549
> > Height = 38
> > Align = alTop
> > BevelOuter = bvNone
> > TabOrder = 2
> > object DBNavigator1: TDBNavigator
> > Left = 16
> > Top = 8
> > Width = 240
> > Height = 25
> > DataSource = DataSource1
> > TabOrder = 0
> > end
> > object btnConnect: TButton
> > Left = 272
> > Top = 8
> > Width = 105
> > Height = 25
> > Caption = 'Connect to db'
> > TabOrder = 1
> > OnClick = btnConnectClick
> > end
> > object btnRun: TButton
> > Left = 392
> > Top = 8
> > Width = 105
> > Height = 25
> > Caption = 'Run SQL'
> > TabOrder = 2
> > OnClick = btnRunClick
> > end
> > end
> > object DBGrid1: TDBGrid
> > Left = 0
> > Top = 153
> > Width = 549
> > Height = 201
> > Align = alClient
> > DataSource = DataSource1
> > TabOrder = 1
> > TitleFont.Charset = ANSI_CHARSET
> > TitleFont.Color = clWindowText
> > TitleFont.Height = -12
> > TitleFont.Name = 'Verdana'
> > TitleFont.Style = []
> > end
> > object Con1: TIB_Connection
> > LoginPrompt = True
> > SQLDialect = 3
> > Params.Strings = (
> > 'SQL DIALECT=3')
> > AfterConnect = Con1AfterConnect
> > AfterDisconnect = Con1AfterDisconnect
> > Left = 12
> > Top = 26
> > end
> > object Trans1: TIB_Transaction
> > AutoCommit = True
> > Isolation = tiCommitted
> > Left = 60
> > Top = 26
> > end
> > object Qry1: TIBOQuery
> > Params = <>
> > IB_Connection = Con1
> > IB_Transaction = Trans1
> > RecordCountAccurate = True
> > RequestLive = True
> > FieldOptions = []
> > Left = 112
> > Top = 26
> > end
> > object DataSource1: TDataSource
> > DataSet = Qry1
> > Left = 40
> > Top = 188
> > end
> > end
> > //////////////////// end of unit1.dfm ///////////////
> >
> > --- In IBObjects@yahoogroups.com, "Jason Wharton" <supportlist@>
wrote:
> >>
> >> I've added this to my list of things to check.
> >> If you would, send me a little sample app to be sure I'm working
> > with your
> >> problem.
> >>
> >> Jason
> >>
> >
> >
> >
> >
> >
I have encountered the same problem. I didn't even know i had it,
until I ran your sample PriceList App and made a purposeful mistake in
the qrPricelist.SQL to see how the error is reported. In
TIB_SESSION.HandleException, at the raise EIB_ISCError.CreateISC...
line, a dialogue pops up and displays all the error details.
Conversely, in my sample app, which uses TIBO components, that DOESN'T
happen! (ie. a dialogue appears withe message:

Project Projecy1.EXE raised exception EIBO_ISCError with message ''.
Process stopped. Use Step or run to continue.

)

Inspection of the variables at that point (tmpText, errocode[0] and so
on) reveals that they are empty)

After stepping through to beyond TIB_Statement.Prepare, a new
MessageDlg type window appears with a nice big red x on smartie and an
ok button. No error message to speak of!

This is making debugging my paradox-conversion project a real pain in
the proverbial to debug.

Any suggestions?
Thanks