Active = False before starting a Delphi application

Asked

Viewed 366 times

2

Every time we work on Datamodule on the connection component, we activate to do tests and the like. It turns out that if we forget to disable when we compile, it can give error when we send to the client due to the IP or user and password being different in development and production.

I use the component TZConnection from Zeos, but I think that goes for everyone.

I wonder if you have a way to disable the component before or on onCreate of form. I’ve seen that at the event onCreate does not help, because it activates the connection even before the onCreate.

2 answers

4

I decided to treat in the Beforeconnect event of the component, there I Seto all the variables related to the connection taking into account if it is Development or Production.

2

since college I learned to perform this type of procedure in the Onshow event instead of Oncreate.

and another tip that I always use is to leave a standard Datamodule on the server saved and another for daily use on other machines, then when I compile the fonts always end up getting the pattern, then this type of error by forgetfulness ends up not occurring.

  • So @Leonardo Maciel, I decided to deal with the component’s Beforeconnect, so it doesn’t matter if I forget how Active, because I know the settings before it connect.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.