LucieLastic
Programmer
hi
Is it possible to Create,link and use a TDatamodule from a TThread object?
Here's my thread objects create which calls the DM's create.
constructor TFilesThread.CreateThread(Progress : TProgressBar; FileName : string);
begin
inherited Create(True);
Priority := tpNormal;
FreeOnTerminate := True;
Suspended := false;
PB := Progress;
sFileName := FileName;
CoFileObject := nil;
CoFileObject := TCompanyFiles.Create(nil); //a TDatamodule
end;
Trouble is, I get an Abstract error in the datamodule's create method.
This is the DM's create code:-
Constructor TCompanyFiles.Create(Owner : Tcomponent);
begin
inherited;
Database_Thread.DatabaseName := ODBCds;
Database_Thread.Connected := true;
end;
How do I link to the Datamodule? I want a datamodule created for each thread. Do I have to create it programmatically, hope not as I have quite a few TQueries in it?
Thanks for any help
lou
Is it possible to Create,link and use a TDatamodule from a TThread object?
Here's my thread objects create which calls the DM's create.
constructor TFilesThread.CreateThread(Progress : TProgressBar; FileName : string);
begin
inherited Create(True);
Priority := tpNormal;
FreeOnTerminate := True;
Suspended := false;
PB := Progress;
sFileName := FileName;
CoFileObject := nil;
CoFileObject := TCompanyFiles.Create(nil); //a TDatamodule
end;
Trouble is, I get an Abstract error in the datamodule's create method.
This is the DM's create code:-
Constructor TCompanyFiles.Create(Owner : Tcomponent);
begin
inherited;
Database_Thread.DatabaseName := ODBCds;
Database_Thread.Connected := true;
end;
How do I link to the Datamodule? I want a datamodule created for each thread. Do I have to create it programmatically, hope not as I have quite a few TQueries in it?
Thanks for any help
lou