Subject | Re: [IBO] Detecting a read only database |
---|---|
Author | bitbanger99 |
Post date | 2006-08-18T02:05:13Z |
--- In IBObjects@yahoogroups.com, Helen Borrie <helebor@...> wrote:
before this form is displayed.) Funny thing is that I can see the
contents of the Characteristics structure in the debugger, but when
the line Sender->Charateristics.dbReadOnly is executed, it looks
like something goes wrong copying an AnsiString. Maybe I should
rebuild the pacakges.
>your
> At 07:02 AM 18/08/2006, you wrote:
> >--- In IBObjects@yahoogroups.com, Helen Borrie <helebor@> wrote:
> > >
> > > You must be using *some* TIB_Connection descendant. Read the
> > > Characteristics property:
> > >
> > > e.g.
> > >
> > > if IBODatabase1.Characteristics.dbReadOnly then
> > >
> >
> >Thanks, Helen. Unfortunatley when I do this, I get a read access
> >violation in C++Builder6.
> >
> >void __fastcall TForm1::DBConnectionAfterConnect(
> > TIB_Connection *Sender)
> >{
> > if (Sender->Characteristics->dbReadOnly){
> > ...
> > }
> >}
> >
> >Seems that copying the Characteristics structure generates an
> >exception. Anyone out there using Builder have this problem?
>
> I can't comment on Builder, but you *will* get an AV if you try to
> read the return structures from an unsuccessful connection. Is
> Connect procedure trapping for that? In this code sample I don'tYes, ConnectionStatus is csConnected. (The connection is verified
> even see the Connected property being tested...
>
before this form is displayed.) Funny thing is that I can see the
contents of the Characteristics structure in the debugger, but when
the line Sender->Charateristics.dbReadOnly is executed, it looks
like something goes wrong copying an AnsiString. Maybe I should
rebuild the pacakges.