Subject | Re: [IBO] DLL/BPL and app with lots of modules |
---|---|
Author | Daniel Rail |
Post date | 2002-01-27T01:03:04Z |
Pass the connection parameters that are not constant for each installation
to the DLL(pathname, server, protocol, username, password). i.e.
ProcName(Server, Pathname: PChar; Protocol: TIB_Protocol);
At the present time, I don't even reference the TIB_Connection of the main
executable.
Example:
ProcName(Server, Pathname: PChar; Protocol: TIB_Protocol);
begin
DLLConn.Server := String(Server);
DLLConn.Pathname := String(Pathname);
DLLConn.Protocol := Protocol;
DLLConn.Connect;
try
{
...
do whatever you need to do
...
}
finally
DLLConn.Disconnect;
end;
end;
The try...finally...end is just to make sure that if there's an error that
occurs after the connect, that at least it gets a chance to call disconnect
before exiting the DLL. The DLLTran.IB_Connection = DLLConn in
design-time. Also, make sure that you have a TIB_Session created.
Daniel Rail
At 26/01/2002 10:49 PM, you wrote:
to the DLL(pathname, server, protocol, username, password). i.e.
ProcName(Server, Pathname: PChar; Protocol: TIB_Protocol);
At the present time, I don't even reference the TIB_Connection of the main
executable.
Example:
ProcName(Server, Pathname: PChar; Protocol: TIB_Protocol);
begin
DLLConn.Server := String(Server);
DLLConn.Pathname := String(Pathname);
DLLConn.Protocol := Protocol;
DLLConn.Connect;
try
{
...
do whatever you need to do
...
}
finally
DLLConn.Disconnect;
end;
end;
The try...finally...end is just to make sure that if there's an error that
occurs after the connect, that at least it gets a chance to call disconnect
before exiting the DLL. The DLLTran.IB_Connection = DLLConn in
design-time. Also, make sure that you have a TIB_Session created.
Daniel Rail
At 26/01/2002 10:49 PM, you wrote:
>I passed the connection as...[Non-text portions of this message have been removed]
>ProcName(Conn : TIB_Connection);
>
>and then in the DLL/Form I did :
>MyQry.IB_Connection := Conn;
>
>Won't this work? Or are you saying that I need to place a
>TIB_Connection and TIB_Transaction IN the DLL/Form
>and then link them as:
>DLLConn.IB_Connection := Conn;
>and
>DLLTran.IB_Connection := Conn; ?
>
>Daniel Rail wrote:
>
> >Are you using a TIB_Connection just for your DLL? If not, then use a
> >TIB_Connection and TIB_Transaction just for the DLL.
> >
> >Just to let you know that I've been using IBO in DLLs since June 2000. So,
> >I should be able to help get into gear.
> >
> >Daniel Rail
> >Senior System Engineer
> >ACCRA Med Software Inc. (www.accramed.ca)
> >
> >At 26/01/2002 10:01 PM, you wrote:
> >
> >>I guess I haven't got it all yet...
> >>I have researched and found that if you use BPLs in your apps you need
> >>to recompile
> >>all of the related parts of an app to keep it working. With DLLs you
> >>only have to watch
> >>for changes in the calling params in the DLL routines. So, in my case,
> >>the DLLs are
> >>more desirable. But in trying this I still cannot get the AVs to go
> >>away. I have tried each
> >>of the ways mentioned above (Sessions in the DLL, etc.) but I have
> >>noticed that the AV
> >>only occurrs when I close the main app. Not when I close the DLL.
> >>Am I still missing something? I set the create order where the session
> >>is created first,
> >>the query closes,and even set the link to the IB_Connection to null just
> >>to get it out.
> >>(Using TIB_Query, etc.) (Can't afford DreamCompany yet)
> >>
> >>Steve Fields
> >>
> >
> >
> >
> >___________________________________________________________________________
> >IB Objects - direct, complete, custom connectivity to Firebird or InterBase
> > without the need for BDE, ODBC or any other layer.
> >___________________________________________________________________________
> ><http://www.ibobjects.com>http://www.ibobjects.com - your IBO community
> resource for Tech Info papers,
> >keyword-searchable FAQ, community code contributions and more !
> >
> >Your use of Yahoo! Groups is subject to
> <http://docs.yahoo.com/info/terms/>http://docs.yahoo.com/info/terms/
> >
> >
> >
>
>
>
>[Non-text portions of this message have been removed]
>
>
>Yahoo! Groups Sponsor
><http://rd.yahoo.com/M=153641.1824646.3335993.1261774/D=egroupweb/S=1705007183:HM/A=919353/R=0/*http://shop.store.yahoo.com/cgi-bin/clink?gloss2+shopping:dmad/M=153641.1824646.3335993.1261774/D=egroupweb/S=1705007183:HM/A=919353/R=1/1012092610+http://us.rmi.yahoo.com/rmi/http://www.gloss.com/rmi-framed-url/http://www.gloss.com/module/Gloss/templates/tools/editors_picks_detail.jhtml>47028f.jpg
>
>
>4703a8.jpg
>
>___________________________________________________________________________
>IB Objects - direct, complete, custom connectivity to Firebird or InterBase
> without the need for BDE, ODBC or any other layer.
>___________________________________________________________________________
><http://www.ibobjects.com>http://www.ibobjects.com - your IBO community
>resource for Tech Info papers,
>keyword-searchable FAQ, community code contributions and more !
>
>Your use of Yahoo! Groups is subject to the
><http://docs.yahoo.com/info/terms/>Yahoo! Terms of Service.