Lazarus

Programming => Databases => Topic started by: daveinhull on February 21, 2019, 02:29:32 am

Title: Using DataModules query
Post by: daveinhull on February 21, 2019, 02:29:32 am
Hi,

I've been working on a program and the number of non-visible objects has grown to a point that I thought I had bettr start using DataModules.
So I moved all the non-visible objects into a Data modules (DataModule1) and add the 'uses' reference to my main form.

I then went through and referenced all the uses with DataModule1. prefex (Know I should seperate the uses better between the main form and the datamodule, but for now I just wanted to try it this way), e.g. DataModule1.Connection1.Connected := True etc.

However, when I run the program, the references to DataModule1 are all zero and it crashes.

Have I forgot to do something, like initialise the the datamodule?

Thanks
Dave
Title: Re: Using DataModules query
Post by: dsyrios on February 21, 2019, 05:02:13 am
Maybe, you have to see this?
http://forum.lazarus.freepascal.org/index.php?topic=41408.0 (http://forum.lazarus.freepascal.org/index.php?topic=41408.0)
Title: Re: Using DataModules query
Post by: daveinhull on February 27, 2019, 02:21:32 pm
Thanks dsyrios, I'll give that a read.
TinyPortal © 2005-2018