Recent

Author Topic: Using DataModules query  (Read 1905 times)

daveinhull

  • Sr. Member
  • ****
  • Posts: 297
  • 1 divided by nothing must still be 1!
Using DataModules query
« 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
« Last Edit: March 19, 2019, 02:18:39 am by daveinhull »
Version #:1.8.4 Date 2019-01-08 FPC Version: 3.0.4 and SVN Revision 57972 for x86_64-win64-win32/win64

dsyrios

  • Jr. Member
  • **
  • Posts: 57
Re: Using DataModules query
« Reply #1 on: February 21, 2019, 05:02:13 am »
Laz 2.0.2/FPC 3.0.4/ win10/64
Laz 2.0.0/FPC 3.0.4/ mint-mate 19.1

daveinhull

  • Sr. Member
  • ****
  • Posts: 297
  • 1 divided by nothing must still be 1!
Re: Using DataModules query
« Reply #2 on: February 27, 2019, 02:21:32 pm »
Thanks dsyrios, I'll give that a read.
Version #:1.8.4 Date 2019-01-08 FPC Version: 3.0.4 and SVN Revision 57972 for x86_64-win64-win32/win64

 

TinyPortal © 2005-2018