tags:

views:

163

answers:

3

I created a costumer's database program. I have a problem in which I create a data module in a DLL and I compile it but then get some error below.

My concept is

The data module created in DLL and I insert ADO components in the data module. This data module is used in another form. I created a db grid in the form but it doesn't show the records in db grid. I compile it but get an error below.

I very thanks to solve my problem... My English is not good but you try to understand........

A: 

As far as I know, there isn't any way for a GUI app to use dataset components in a DLL directly.

You might have better lock using packages, which are more Delphi object friendly. I haven't tried this, so I can't give much advice.

Or you could have your DLL pass back the dataset, which you put into a TClientDataset in you GUI application.

Bruce McGee
A: 

The main difference between dll usage and packages is the shared memory model.

You can simply put a dbconnection in a package. a datamodule in another one. and the best of all is you can load & unload them at your convenience. Then you have access to this elements by unit usage.

Francis Lee
+1  A: 

TDataModule is just like a form but it's purpose is to be sort of a container form and is invisible to the end user. Although you can create a TDataModule in a DLL, it is not meant to be like that. TDataModules are there for the sake of simplifying your interaction with the whole app. Not to complicate it!!

IMHO, Don't create DataModules in a dll.

From your description, I think that you want a central datastore-like-module that is separate from the app that interacts with the user. May be there are more than one user. If that is the case try client-server approach.

Olaf