Recent

Author Topic: DataModule link durring design time  (Read 6318 times)

Skot

  • Newbie
  • Posts: 3
DataModule link durring design time
« on: February 14, 2006, 04:53:27 pm »
Hello again,

One little thing, maybe it should be a want.  When I build apps, usually like to put all my Queries and DataSources etc in a DataModule.  However, in design time, I can't see how to get objects, like TdbGrid, to recognise a DataSource in the DM.  If I type DM.dsBlah in the DataSource param I get an error message, 'Invalid Propery Value', but it shouldn't be.  The DM unit is in the Uses clause.  Is there something else I need to do, or is this just the way it is?

Not a big deal, I always write it into the CreateForm proc anyway, just would be convenient sometimes.

Cheers.

hadelmestre

  • Newbie
  • Posts: 2
Re: DataModule link durring design time
« Reply #1 on: July 05, 2009, 08:00:17 pm »
Por lo que tengo entendido, el equipo de desarrollo estaria solucionando esta instancia o "bug".
Es decir, por ahora no funciona
Atte.
Hectorr

clauslack

  • Sr. Member
  • ****
  • Posts: 275
Re: DataModule link durring design time
« Reply #2 on: July 06, 2009, 12:56:34 am »
In my case I have in the Object Inspector this property, without problems.

In design time, SQLQuey1 (Form1)
Database -> FormDatos.IBConnection1

FormDatos is a TDataModule.

With Lazarus 0.9.27 and fpc 2.2.4 /2.2.5




Lord_ZealoN

  • Full Member
  • ***
  • Posts: 141
    • http://lordzealon.com
Re: DataModule link durring design time
« Reply #3 on: July 06, 2009, 09:48:20 am »
Hello again,

One little thing, maybe it should be a want.  When I build apps, usually like to put all my Queries and DataSources etc in a DataModule.  However, in design time, I can't see how to get objects, like TdbGrid, to recognise a DataSource in the DM.  If I type DM.dsBlah in the DataSource param I get an error message, 'Invalid Propery Value', but it shouldn't be.  The DM unit is in the Uses clause.  Is there something else I need to do, or is this just the way it is?

Not a big deal, I always write it into the CreateForm proc anyway, just would be convenient sometimes.

Cheers.

Are you using lazarus 0.9.26-2? With svn version works ok.

musicones

  • New Member
  • *
  • Posts: 15
Re: DataModule link durring design time
« Reply #4 on: September 07, 2009, 09:42:01 am »
Hello,

I have the same problem (using Lazarus 0.9.26-2 / FPC 2.2.2). But I know that it should work, because I have one link from Transaction in ContactModule to the TIBConnection in DatabaseModule.

>> It's all about the Design-Mode. <<


Here is my design:

DatabaseModule: TDataModule contains: TIBConnection, TTransaction

ContactsModule: TDataModule contains:
  TTransaction -> linked to DatabaseModule.IBConnection (don't ask how/why the linking worked, i don't know)
  TSQLQuery -> linked to TTransaction on same Module

Now I have tried two different approaches.
In both cases one link doesnt work:

1. TDataSource placed in ContactsModule and linked to TSQLQuery
    Trying to link from ContactsForm.Grid.DataSource to ContactsModule.DataSource doesn't work

2. TDataSource placed in COntactsForm, linked to Grid
    Trying to link from ContactsForm.DataSource.DataSet to ContactsModule.SQLQuery doesn't work.

What means doesn't work:

in uses part the according unit is set, e.g in ContactsForm .... uses mContacts (ContactsModule)

1. The link is not shown in Object Inspector e.g. when you click on DataSource or DataSet
2. Trying to write it manually tends to result in error Message: 'Invalid Propery Value'

If someone knows the trick....  ::)

musicones

  • New Member
  • *
  • Posts: 15
Re: DataModule link durring design time
« Reply #5 on: September 10, 2009, 09:03:12 am »
Hi again,

i've tried Lazarus 0.9.27 Snapshot of yesterday. There it seems to work. So i suppose an bug in current release. I will wait for next release then.

Edit:
I have found out why that doesn' work as i expected. Usually i use to create and free the Datamodules myself runtime where i need them. Therfore you have to throw out the Create in the project file. If you do that, the controls do not recognize the DataSources and Querys in the Datamodule. I used to do that in Delphi where it works without problems. It seems that Lazarus doesn't support it.

regards
musicones
« Last Edit: September 12, 2009, 09:56:07 am by musicones »

 

TinyPortal © 2005-2018