Subject Re: [IBO] Design Mode IB_Qurey IB_Connection in DMod has to bee Active
Author Helen Borrie
At 03:57 PM 13-11-02 +0200, you wrote:
>I have a IB_Query that is connected to a IB_Connection in a Datamodule.
>the Datamodule is Not connected in Design mode after I open my
>Project.
>
>How can I fix this so that when I open my Project and I add a New IB_Query
>and set the Connection property and then Double Click will auto
>connect.
>
>I have seen that the Contacts Example prompts you with a Dialog.

You need to write run-time code to open the connection - typically in the
FormCreate event of the Datamodule.

...
if not IB_Connection1.Connected then
IB_Connection1.Connect;
...

Similarly to open an IB_Query, you need to call its Open method:

...
if not IB_Query1.Active then
IB_Query1.Open;
...

The login dialog of the connection object is invoked automatically if the
LoginPrompt property is true.
In all cases you have to supply the user name and password to get a
connection to Fb/IB. You need to set the PasswordStorage property: psNone
will require that the user supply user name, password and (if applicable)
role. psNotSecure will enable a non-secure login, for which you will need
to save the user name and password in your application. For that you would
normally set LoginPrompt false.
There are two other PasswordStorage options - read the Help or the online
FAQ to understand the requirements for these.

If you are using a datamodule and you plan to have any datasets active when
the project opens, make sure that you go to the project unit (.dpr) and
move its Application.Create statement up so that it is positioned BEFORE
the ones for your forms.

Helen