Is it possible ??? (TTable>EXE&DLL)

Is it possible ??? (TTable>EXE&DLL)

Post by Vlatk » Fri, 13 Apr 2001 03:23:42



I have a table in EXE, and grid in DLL form. Can I somehow pass that EXE
table to the DLL so my grid can display data even though DLL hasn't that
table? I'm asking because I have lots of forms in DLLs. My data are on
Interbase ClientServer and every time I run the DLL form Delphi connects
the table to the server. It takes a few seconds but if you have to wait
every time you've opened a different form it's a very long time. In
other words can I connect a grid in DLL with table (dataset) in EXE? Any
ideas?

Thanks.

P.S. Sorry if I've posted this on the wrong newsgroup but I'm not quite
sure where it belongs.

 
 
 

Is it possible ??? (TTable>EXE&DLL)

Post by Donald Kloppe » Fri, 13 Apr 2001 03:45:43


The best technique I know of is to pass the database handle to the DLL.

Eg. Define a TDatabase component in both the exe and the DLL, but only
"open" it in the Exe. (You'll need to point all of your "tables" to the
appropriate database component, obviously). Then proceed to call a DLL
function that you provide, passing the database handle from the EXE. Note
that the datbabase MUST already be open at this point. The DLL should, upon
receiving this handle, point its own databasecomponent's handle to that
handle, and then you share data between DLL and EXE, and both have SQL or
whatever access to the connected database.

HTH

--
------------------
Donald Klopper
Tel: +27 12 348-4301
Cell: +27 82 468-7480


Quote:> I have a table in EXE, and grid in DLL form. Can I somehow pass that EXE
> table to the DLL so my grid can display data even though DLL hasn't that
> table? I'm asking because I have lots of forms in DLLs. My data are on
> Interbase ClientServer and every time I run the DLL form Delphi connects
> the table to the server. It takes a few seconds but if you have to wait
> every time you've opened a different form it's a very long time. In
> other words can I connect a grid in DLL with table (dataset) in EXE? Any
> ideas?

> Thanks.

> P.S. Sorry if I've posted this on the wrong newsgroup but I'm not quite
> sure where it belongs.


 
 
 

1. ODBC program exe -> dll problem

I have written some very simple ODBC code compiled as an EXE and it does everything that I want it to do.  I then took that code and put it in an ISAPI extension DLL.  Now I get an error on the CDatabase::Open() function call.  I used the lpszConnect parameter for this connect.
Only SQL_DRIVER_NOPROMPT is allowed when connection pooling is enabled
State:S1110,Native:0,Origin:[Microsoft][ODBC Driver Manager]
Err code = -1

How do I turn off pooling for a CDatabase object?  Do I have to use the win32 function calls and forget about CDatabase for this project?  

When I use the lpszDSN parameter for the CDatabase::Open() I get an invalid handle error when I try to insert data using SQLExecute().

Any Ideas?

Thanks,
            Craig.

2. Anounce: Blackie to provide WWW/RDBMS gateway

3. IIS->ISAPI->Delphi DLL->BDE->Paradox

4. Replication from 6.5 to 7.0

5. IBInstall component BUG, 401COMUPD.EXE & COMCTL32.DLL

6. move db in another disk

7. libpq.dll & psql.exe on Win32

8. Read/write cursor

9. Which DLL/Exe calls Dao2516.dll?!

10. brequest.exe <-> breqnt.exe

11. How to pass a value from EXE -->IE50 container -->ActiveX Document

12. -- H E L P -- Using TTable in DLL --

13. Persistant Database connection when using TTable components in a DLL