Subject Re: [IBO] Records show at design time but not runtime
Author Helen Borrie
At 09:25 PM 10/03/2006, you wrote:
>I've placed TIB_Connection, TIB_Query, TIB_Datasource onto a DataModule.
>
>I've placed TIB_Grid, TIB_Navigationbar, TIB_Searchbar, TIB_Updatebar
>onto a form.
>
>The form "uses" the datamodule.
>
>Everything seems to be active and I can see the data in the grid at
>design time. But when I run the Form the grid comes up blank and the
>TIB_Navigationbar, TIB_Updatebar are greyed out.
>
>Tips would be greatly appreciated.

In the FormCreate method of the datamodule you must connect to the
database. If you want the form to open with the dataset open, you
have to open it!

Let's say the datamodule is DM and the components have their default
assigned names here...

begin
if not ib_connection1.Connected then
ib_connection1.Connect;
with ibquery1 do
begin
if not ib_transaction.started then
ib_transaction.StartTransaction;
Open;
end;
end;

Once you get the hang of it, you will need to build in some exception
handling with try...except but this will do for now. :-)

Helen