Zitat von ik <[email protected]>:

Hello,

I'm using Lazarus 0.9.29 r22691M FPC 2.5.1 x86_64-linux-gtk 2 (beta).
When I create a form and place in the uses section of the interface the data
module, some forms with data aware components can find the datasource, while
other forms with data aware components can not find the Datasources.

For example:

unit unit1;

interface
Classes , SysUtils , db , sqldb , XMLCfg , FileUtil ,
  LResources , Forms , Controls , Graphics , Dialogs , DbCtrls , ExtCtrls ,
  ComCtrls , StdCtrls , Buttons, dmDatabases;

type
  TForm1 = class(TForm)
 ...
end;
...
end.

unit unit2;

interface
Classes , SysUtils , db , sqldb , XMLCfg , FileUtil ,
  LResources , Forms , Controls , Graphics , Dialogs , DbCtrls , ExtCtrls ,
  ComCtrls , StdCtrls , Buttons, dmDatabases;

type
  TForm2 = class(TForm)
 ...
end;
...
end.

The first form will find the datasource components on dmDatabases unit,
while the second form will not.

What am I missing here ?

I assume, you have connected the datasource in the IDE designer and not via code. Then the connection is stored in the lfm file and the uses section has nothing to do with it. Just make sure, that your program creates the datamodule before the two forms are created (for example Application.CreateForm statements in the lpr).


Mattias



--
_______________________________________________
Lazarus mailing list
[email protected]
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus

Reply via email to