Recent

Author Topic: datamodule - please do NOT log me in  (Read 825 times)

Nicole

  • Hero Member
  • *****
  • Posts: 972
datamodule - please do NOT log me in
« on: August 25, 2022, 08:56:28 am »
When I open my lazarus-project, a login prompt pops up, asking for my database password.

At the moment, I just want to work with my code and not key in passwords.
How can I get rid of this hello-screen (created by my datamodul)?

I disabled prompts wherever I could and keyed in the password in the masks I thought, it would stop asking-for-password.

or in other words:
I would prefer the result-situation, if I click "cancel" in this dialog, - but without dialog.


Zoran

  • Hero Member
  • *****
  • Posts: 1831
    • http://wiki.lazarus.freepascal.org/User:Zoran
Re: datamodule - please do NOT log me in
« Reply #1 on: August 25, 2022, 09:12:51 am »
You didn't provide details, but this is probably the case - on that datamodule you have some database component and this database component has "connected" property set to true, so it tries to connect to underlying database in design time.

Set this property to false in object inspector, so that it does not connect in design time and set it to true in code, so it will connect in runtime only.

Sometimes, you might need active connection in design time, eg. if you want persistent fields in some query component - then you can set connected to true in object inpector, open the transaction and query, create the fields, but then after the fields had been created, you can set connected to false again.

MarkMLl

  • Hero Member
  • *****
  • Posts: 6692
Re: datamodule - please do NOT log me in
« Reply #2 on: August 25, 2022, 10:32:27 am »
Nicole, you are starting a lot of threads about very similar issues. Looking at one of your older ones, please note my comment that you will get into deep water if editing the content of a frame after it has been placed on a form.

In other words, /if/ your datamodule etc. is in a frame, make sure that the connected property of the relevant controls was set false when designing the frame.

MarkMLl
MT+86 & Turbo Pascal v1 on CCP/M-86, multitasking with LAN & graphics in 128Kb.
Pet hate: people who boast about the size and sophistication of their computer.
GitHub repositories: https://github.com/MarkMLl?tab=repositories

rvk

  • Hero Member
  • *****
  • Posts: 6169
Re: datamodule - please do NOT log me in
« Reply #3 on: August 25, 2022, 11:27:23 am »
When I open my lazarus-project, a login prompt pops up, asking for my database password.
Actually I noticed this too in IBX.
But first... did you set the Login Prompt in the object inspector (left side) of TIBDatabase to false?
If yes... did you put this in the Params?
Quote
user_name=SYSDBA
password=masterkey

If yes... then this seems to be a bug.
When switching to Connected = true in design-time I also get a login prompt.
It shouldn't happen if you set Login prompt to false and the correct Params.
It should use these settings to automatically login and connect.
(Or we missed something...)

(My settings are correct because I have a simple program that does nothing but IBDatabase.Connected := true and at runtime it doesn't prompt me for login. Just only at design time.

Nicole

  • Hero Member
  • *****
  • Posts: 972
Re: datamodule - please do NOT log me in
« Reply #4 on: August 25, 2022, 06:11:07 pm »
To my mind, I did all that: "disconnect" and parameter settings (3 of them, name, pw and coding).
And not to forget: Set login prompt to false.
You told me so.

I will keep an eye on and if I suspect it may be a bug, I will try to make the "empfloyee.fdb" run and generate a project.

rvk

  • Hero Member
  • *****
  • Posts: 6169
Re: datamodule - please do NOT log me in
« Reply #5 on: August 27, 2022, 02:52:52 pm »
@tonyw Can you confirm that this is a bug?
Setting Login-prompt to false doesn't work for design time connections.

I create an empty project with a TIBDatabase on it.
In the Connection editor (right click) I set all the correct login parameters.
I also deselect Login-prompt and make sure "Test" says successful.

I click Ok and I again make sure Login-prompt is false in the object inspector.
Now I click Connected to true.... and IBX prompts me for a login.

My guess this is a bug. It shouldn't ask me in design time for a login when everything is set correctly and login prompt is false.
(At least it never did in the past)

Nicole

  • Hero Member
  • *****
  • Posts: 972
Re: datamodule - please do NOT log me in
« Reply #6 on: August 27, 2022, 04:29:45 pm »
to add, I was asked via PM:
What happens, when you just key in the "masterkey"?

This I found:
It works, the waiting time of 1 minute as punishment for hitting 'cancel' instead is suspended. ;-)
The project opens to work.

BUT:
The database property "connected" is checked.
I can uncheck it and everything is fine and my project ready to work on.

The point is:
I WANT my connected-property set to false on startup.
So I am forced to connect on opening and I have to disconnect manually.




 

TinyPortal © 2005-2018