Subject | Re: [IBO] Passing an IB_Connection to a dll function |
---|---|
Author | Robert martin |
Post date | 2004-11-04T23:31:11Z |
Hi
I am dynamically creating the dll from within my thread (I was all along, just thought I wasn't :) ) and passing the IBODatabase.db_handle to the dll. In the dll I set the IBODatabase.db_handleshared to db_handle. However at this point I get the following error.
ISC ERROR MESSAGE:
invalid database handle (no active connection)
The database is connected in the main application. The IBODatabase component in the DLL has all the standard properties set (Level, page size, username, password etc). Connection is TCP/IP.
I use IBODatabase in the main app so continued to use it in the DLL. The db_handle is passed as a pointer.
Any ideas what could be causing the problem, have I missed something?
Rob Martin
Software Engineer
phone 03 377 0495
fax 03 377 0496
web www.chreos.com
Wild Software Ltd
I am dynamically creating the dll from within my thread (I was all along, just thought I wasn't :) ) and passing the IBODatabase.db_handle to the dll. In the dll I set the IBODatabase.db_handleshared to db_handle. However at this point I get the following error.
ISC ERROR MESSAGE:
invalid database handle (no active connection)
The database is connected in the main application. The IBODatabase component in the DLL has all the standard properties set (Level, page size, username, password etc). Connection is TCP/IP.
I use IBODatabase in the main app so continued to use it in the DLL. The db_handle is passed as a pointer.
Any ideas what could be causing the problem, have I missed something?
Rob Martin
Software Engineer
phone 03 377 0495
fax 03 377 0496
web www.chreos.com
Wild Software Ltd
----- Original Message -----
From: Daniel Rail
To: IBObjects@yahoogroups.com
Sent: Friday, November 05, 2004 1:07 AM
Subject: Re: [IBO] Passing an IB_Connection to a dll function
Hi,
At November 4, 2004, 00:37, Robert martin wrote:
> In our app we have an ability to call a Dll function each time and
> transaction is processed. Under Dbase we just connected to the database for
> a second time, under Firebird this would require another connection (which
> can be slow). We want to avoid this, can a Ib_Connection be passed to a dll
> function?
What I usually do, is pass the TIB_Connection.dbHandle property to the
DLL and assign it to the TIB_Connection.dbHandleShared property in the
DLL. And, you don't have to call Connect and Disconnect, since you are
already using an existing connection handle.
> If that is possible, is there any problem if it is passed from a thread in
> the main application?
If the DLL is dynamically loaded and unloaded within the context of the thread,
then I don't see any problems. Otherwise, there would most likely be
problems.
--
Best regards,
Daniel Rail
Senior System Engineer
ACCRA Group Inc. (www.accra.ca)
ACCRA Med Software Inc. (www.filopto.com)
___________________________________________________________________________
IB Objects - direct, complete, custom connectivity to Firebird or InterBase
without the need for BDE, ODBC or any other layer.
___________________________________________________________________________
http://www.ibobjects.com - your IBO community resource for Tech Info papers,
keyword-searchable FAQ, community code contributions and more !
Yahoo! Groups Sponsor
ADVERTISEMENT
------------------------------------------------------------------------------
Yahoo! Groups Links
a.. To visit your group on the web, go to:
http://groups.yahoo.com/group/IBObjects/
b.. To unsubscribe from this group, send an email to:
IBObjects-unsubscribe@yahoogroups.com
c.. Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.
[Non-text portions of this message have been removed]