Subject | Re: [IBO] New user - IB_Query help |
---|---|
Author | emgfyah2002 |
Post date | 2002-04-08T13:18:58Z |
--- In IBObjects@y..., "Helen Borrie (TeamIBO)" <helebor@t...> wrote:
I followed your instructions and it is almost working. I used as a
test the following code:
Ib_transaction1.StartTransaction;
ib_query1.insert;
ib_query1.fieldbyname('MyField1').value := '1111111'; {PK}
ib_query1.fieldbyname('MyTime').value := Now; {PK}
ib_query1.fieldbyname('MyValue').Value := 'Test value';
ib_query1.Post;
ib_Transaction1.CommitRetaining;
In the form I have the IB_Datasource1, IB_Query1, IB_Transaction1 and
a IB_Grid1 components. IB_Query1 with KeylinksAutodefine = True.
After the execution, the new record apears in the grid but if I close
the application, and re-opens it, the new inserted record is not
present. I tryed also with the transaction autocomit set to true. In
the real application, I will need to have complete control of
transaction controlling simultaneous insertions in 3 different tables.
Thank You for your attention, best regards
Edison
> At 12:55 AM 08-04-02 +0000, you wrote:started
> >Hi. I am just starting to use IBO. I am converting an application
> >from IBExpress for the IBO ( using Firebird and IBO last releases).
> >I had no problems at all with the select SQL operations, ( I
> >the conversion by consulting and report units ), but I need somehelp
> >for insert and update operations with the IB_Query. If I use theuse
> >IB_updatebar everything works beautifully. But I need to command
> >insertions and updates by code. It is really very usefull the way
> >IBO creates the insert, delete and update SQL strings, but how to
> >then ? How to "ask" to IB_Query to use the insert or the delete SQLthe
> >string ?
>
> Edison,
> If your insert, update and deletes simply work with the fields in
> current row of the select, you don't need to use the InsertSQL,EditSQL and
> DeleteSQL strings at all - IBO will construct them automaticallywhen you post.
>that is
> If you have custom statements to perform any of these operations,
> when you use the xxxxxSQL properties.datasets. If
>
> Always with IBO, you need to have correct KeyLinks for your
> the dataset is unusual (e.g. a join, or doesn't contain the primarykey)
> it's safest to set them yourself. If the primary key is in thedataset and
> is unique, you can just set KeylinksAutodefine to True.procedure, you
>
> Set the RequestLive property to True.
>
> In all cases, all you have to do is call the Insert, Edit or Delete
> method. In the case of custom SQL, e.g. calling a stored
> may need to pass input parameters yourself. However, if theparameter
> names of the xxxxSQL statements match the field names of thedataset, IBO
> will take care of these, too.Dear Helen
>
>
> regards,
> Helen Borrie (TeamIBO Support)
>
> ** Please don't email your support questions privately **
> Ask on the list and everyone benefits
> Don't forget the IB Objects online FAQ - link from any page at
> www.ibobjects.com
I followed your instructions and it is almost working. I used as a
test the following code:
Ib_transaction1.StartTransaction;
ib_query1.insert;
ib_query1.fieldbyname('MyField1').value := '1111111'; {PK}
ib_query1.fieldbyname('MyTime').value := Now; {PK}
ib_query1.fieldbyname('MyValue').Value := 'Test value';
ib_query1.Post;
ib_Transaction1.CommitRetaining;
In the form I have the IB_Datasource1, IB_Query1, IB_Transaction1 and
a IB_Grid1 components. IB_Query1 with KeylinksAutodefine = True.
After the execution, the new record apears in the grid but if I close
the application, and re-opens it, the new inserted record is not
present. I tryed also with the transaction autocomit set to true. In
the real application, I will need to have complete control of
transaction controlling simultaneous insertions in 3 different tables.
Thank You for your attention, best regards
Edison