Subject Re: [IBO] Please help me
Author Helen Borrie
At 01:10 AM 12/02/2005 +0000, you wrote:

>I found out that when a tib_dataset is open, it automatically prepares
>the insertsql and the updatesql. And I have also notice that when the
>table is blank it prepares the insertsql, but when the table has
>records it prapares the editsql. Is this the nature of IBO?

Yes. You will also get the InsertSQL prepared if you scroll a live dataset
past EOF.

>My problem is how to prevent prevent the ibo from preparing those
>statement? Without removing the sql statements in the insertsql and updatesql.

If you don't want a live dataset at all, don't set XXXSQL properties and
don't set RequestLive true.

If you want to have it so that you can decide whether it will be live or
not, according to some run-time conditions, then set the properties of the
linking IB_Datasource to suit your needs. Look at CanModify, AutoEdit and

Alternatively, just set the RequestLive and xxxSQL properties of the
dataset at run-time, as required.

Going by some of your earlier confused posts about the way dataset state is
automated.....where you want some users to be able to update datasets while
others can't - define a Boolean property of the form or datamodule that can
be set at connection time to condition what specific users/roles are
allowed to do. Assuming you use roles, or you set up user privileges with
enough granularity, your code can read this property at any time and make
decisions according to its value.