Tobassum Munir
Tobassum Munir

Reputation: 405

Data Module in Dll with delphi?

I created a database program which has a problem. I used Borland Delphi 7.x

My Question is

"How to create a data module in Dll (Dynamic Link Library) With Delphi?

Upvotes: 1

Views: 4472

Answers (2)

Robert Love
Robert Love

Reputation: 12581

You can create the code from the data module, just like you would in a normal application. File|New|Data Module

But I am guessing that you want to create an instance of a data module in a DLL.

DataModules are no different other classes and components, and can be created in code.

var
  DM : TMyDataModule;
begin
  DM := TMyDataModule.Create(nil); 
  try
 // Then...   DM.MyDataSet.First; etc...
  finally
    DM.Free; 
  end;
end;

Upvotes: 2

Bruce McGee
Bruce McGee

Reputation: 15334

Open your DLL project in the IDE. Under the File|New menu, do you see an option for Data Module?

Upvotes: 1

Related Questions